| [11887] | 1 | Trac Narcissus Plugin |
|---|
| 2 | --------------------- |
|---|
| 3 | |
|---|
| 4 | Description |
|---|
| 5 | =========== |
|---|
| 6 | |
|---|
| 7 | Narcissus is a plugin for Trac that provides an interactive visualisation |
|---|
| 8 | for mirroring the activities of small groups over a period of months. |
|---|
| 9 | The activities are measured differently for each resource. Contributions to |
|---|
| 10 | the wiki and Subversion repository are measured according to the number of |
|---|
| 11 | added lines. Tickets are scored according to the type of activity, such as |
|---|
| 12 | creating, accepting, and resolving tickets, as well as adding comments at |
|---|
| 13 | different stages of the task. |
|---|
| 14 | |
|---|
| 15 | Users have the ability to control the value placed in each activity. The |
|---|
| 16 | underlying measures of the visualisations are very simple; it is important |
|---|
| 17 | that this is clear to the users. |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | Requirements |
|---|
| 21 | ============ |
|---|
| 22 | |
|---|
| 23 | The narcissus plugin requires the Python Imaging Library (PIL) to |
|---|
| 24 | produce PNG images, and must be installed on your system. It can |
|---|
| 25 | be downloaded from http://www.pythonware.com/products/pil. |
|---|
| 26 | |
|---|
| 27 | |
|---|
| 28 | Optional requirements |
|---|
| 29 | ===================== |
|---|
| 30 | |
|---|
| 31 | Any TrueType font may be used for the narcissus visualisations. Microsoft's |
|---|
| 32 | TrueType core fonts can be downloaded from http://corefonts.sourceforge.net/ |
|---|
| 33 | for Linux and from http://web.nickshanks.com/typography/corefonts for Mac |
|---|
| 34 | or Windows systems. |
|---|
| 35 | |
|---|
| 36 | |
|---|
| 37 | Installation via Source |
|---|
| 38 | ======================= |
|---|
| 39 | |
|---|
| 40 | The installation of the narcissus plugin from source is done by |
|---|
| 41 | creating a Python egg distribution file and copying the .egg file to |
|---|
| 42 | the Trac plugins directory. Detailed information on Python eggs can be |
|---|
| 43 | found at http://peak.telecommunity.com/DevCenter/PythonEggs. In |
|---|
| 44 | addition, the Easy Install package is required to create Python |
|---|
| 45 | eggs. See http://peak.telecommunity.com/DevCenter/EasyInstall for more |
|---|
| 46 | information on using and installing Easy Install. |
|---|
| 47 | |
|---|
| 48 | Checkout the source code for the narcissus plugin from: |
|---|
| 49 | http://praxis.it.usyd.edu.au/svn/kim/hons/Project/narcissus-plugin |
|---|
| 50 | |
|---|
| 51 | Change to the narcissusplugin/0.10 directory and run: |
|---|
| 52 | |
|---|
| 53 | python setup.py bdist_egg |
|---|
| 54 | |
|---|
| 55 | This will generate a python egg in the dist directory. Copy the egg |
|---|
| 56 | file into the trac/plugins directory and follow the Configuration |
|---|
| 57 | steps outlined below. |
|---|
| 58 | |
|---|
| 59 | We are currently looking at adding the narcissus plugin to the |
|---|
| 60 | swapoff repository hosted by http://trac-hacks.org/ in the future, |
|---|
| 61 | as the plugin matures. |
|---|
| 62 | |
|---|
| 63 | Configuration |
|---|
| 64 | ============= |
|---|
| 65 | |
|---|
| 66 | Once the narcissus plugin has been installed either via source or via a |
|---|
| 67 | python egg, some configuration is needed before it can be used. |
|---|
| 68 | |
|---|
| 69 | A new section called narcissus should be added to the conf/trac.ini |
|---|
| 70 | file with these fields: |
|---|
| 71 | |
|---|
| 72 | cache_dir - The directory that will be used to cache the |
|---|
| 73 | generated images. |
|---|
| 74 | |
|---|
| 75 | cache_manager - If this entry exists in the configuration file, |
|---|
| 76 | then the cache management logic will be invoked |
|---|
| 77 | and the cache_max_size, cache_min_size, |
|---|
| 78 | cache_max_count and cache_min_count must be |
|---|
| 79 | defined. |
|---|
| 80 | |
|---|
| 81 | cache_max_size - The maximum size in bytes that the cache should |
|---|
| 82 | consume. This is the high watermark for disk space |
|---|
| 83 | used. |
|---|
| 84 | |
|---|
| 85 | cache_min_size - When cleaning out the cache, remove files until |
|---|
| 86 | this size in bytes is used by the cache. This is |
|---|
| 87 | the low watermark for disk space used. |
|---|
| 88 | |
|---|
| 89 | cache_max_count - The maximum number of files that the cache should |
|---|
| 90 | contain. This is the high watermark for the directory |
|---|
| 91 | entry count. |
|---|
| 92 | |
|---|
| 93 | ttf_path - The path (including directory and filename) of the |
|---|
| 94 | TrueType font to be used for visualisation. Optional. |
|---|
| 95 | |
|---|
| 96 | The cache_dir directory must exist and the Trac server must have read |
|---|
| 97 | and write access. |
|---|
| 98 | |
|---|
| 99 | The cache manager is an attempt at keeping the cache directory under |
|---|
| 100 | control. This is experimental code that may cause more problems than |
|---|
| 101 | it fixes. The cache manager will be invoked only if a new Narcissus |
|---|
| 102 | image is to be produced. If the image can be loaded from the cache, |
|---|
| 103 | then the cache manager shouldn't need to run. This should minimize the |
|---|
| 104 | I/O performance impact on the trac server. When the cache manager |
|---|
| 105 | determines that it should clean up the cache, it will delete files |
|---|
| 106 | based on the file access time. The files that were least accessed will |
|---|
| 107 | be deleted first. |
|---|
| 108 | |
|---|
| 109 | Note: it is also recommended that the restrict_owner field under the |
|---|
| 110 | ticket section of the configuration file should be set to true, in |
|---|
| 111 | order to get the most out of the ticket view of the visualisation: |
|---|
| 112 | |
|---|
| 113 | [ticket] |
|---|
| 114 | restrict_owner = true |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | Configuration Example |
|---|
| 118 | +++++++++++++++++++++ |
|---|
| 119 | |
|---|
| 120 | Here is a sample narcissus section: |
|---|
| 121 | |
|---|
| 122 | [narcissus] |
|---|
| 123 | cache_dir = /tmp/trac/htdocs/narcissus |
|---|
| 124 | cache_manager = yes |
|---|
| 125 | cache_max_size = 10000000 |
|---|
| 126 | cache_min_size = 5000000 |
|---|
| 127 | cache_max_count = 2000 |
|---|
| 128 | cache_min_count = 1500 |
|---|
| 129 | ttf_path = /usr/share/fonts/truetype/msttcorefonts/arial.ttf |
|---|
| 130 | |
|---|
| 131 | Note: /tmp may be cleaned after reboot depending on your platform and |
|---|
| 132 | system preferences, which implies that the cache directory would need |
|---|
| 133 | to be recreated after a reboot if it has been set to the above example. |
|---|
| 134 | |
|---|
| 135 | The cache manager is turned on since there is an entry in the narcissus |
|---|
| 136 | section called cache_manager. The value doesn't matter. To turn off |
|---|
| 137 | the cache manager, simply comment out the cache_manager entry. |
|---|
| 138 | |
|---|
| 139 | When the size of all the files in the cache directory exceeds |
|---|
| 140 | 10,000,000 bytes or the number of files in the cache directory exceeds |
|---|
| 141 | 2,000, then files are deleted until the size is less than 5,000,000 |
|---|
| 142 | bytes and the number of files is less than 1,500. |
|---|
| 143 | |
|---|
| 144 | Here's the same example but for Windows systems: |
|---|
| 145 | |
|---|
| 146 | [narcissus] |
|---|
| 147 | cache_dir = C:\projects\plugins\env\trac\htdocs\narcissus |
|---|
| 148 | cache_manager = yes |
|---|
| 149 | cache_max_size = 10000000 |
|---|
| 150 | cache_min_size = 5000000 |
|---|
| 151 | cache_max_count = 2000 |
|---|
| 152 | cache_min_count = 1500 |
|---|
| 153 | ttf_path = C:\windows\fonts\arial.ttf |
|---|
| 154 | |
|---|
| 155 | |
|---|
| 156 | Contributors |
|---|
| 157 | ============ |
|---|
| 158 | |
|---|
| 159 | Some of the source code in the narcissus plugin was adapted from: |
|---|
| 160 | |
|---|
| 161 | * Trac/Timeline.py, Copyright (c) Edgewall Software |
|---|
| 162 | * The graphviz plugin, Copyright (c) Peter Kropf |
|---|
| 163 | * The peerreview plugin, Copyright (C) Team5 |
|---|
| 164 | |
|---|
| 165 | Many thanks to Trent Apted for random smatterings of help and advice. |
|---|