Trac Downloader plug-in
Project release downloader plugin for Trac system with optional questionnaire before download of file, Captcha antirobot check, stats module and easy to use administration in Trac WebAdmin plug-in.
See also DownloadsPlugin.
- view on main list of downloads
- questionnaire with captha to get information about user who downloads
- administration of files for download
- administration of statistics and questionnaire fill up's
- statistics of downloads by years
- statistics of downloads by months
- statistics of files (releases and categories has this too)
Planned features and improvements
- rewrite all templates from ClearSilver to Genshi
- display and request captcha only first time in session
- nicer rendering of forms and fix some rendering problems
- support for searching in files and notes
- support for Tags
- some aggregations of data filled in user defined questionnaire
Plug-in was tested on Python 2.3 - Trac 0.9.6 and Trac 0.10.4, first successful tests were made on Trac 0.11b1! But be patient if there are still some bugs and report every problem you find.
If you have any issues, create a new ticket.
If you don't like Subversion you can download egg or full source here:
Here are some screenshots too.
The easiest way to start using Downloader plug-in is to get downloaded python egg into plugin directory of project environment (egg is most probably python version independent, just rename it, but who knows, there's still source package...), after that you must turn both modules of Downloader on in WebAdmin/plugins (Downloader is dependent on WebAdmin plug-in). And finally there is need to get some permissions of Downloader to some users... In this case if you like to use PyCaptcha, you must take care of installing it by yourself, PyCaptcha is dependent on PIL so you must download it too.
SOURCE - installation with PyCaptcha and Python Imaging Library (PIL) which are needed for Captcha to work
easy_install --find-links http://www.pythonware.com/products/pil/ Imaging easy_install PyCaptcha easy_install http://trac-hacks.org/svn/tracdownloaderplugin/0.10/
Second and maybe better way is to download and unpack somewhere source zip package and then just run "setup.py install" (or on windows maybe better "python setup.py install") or you can just use easy_install commands written above.
Setup should take care of all dependences (PyCaptcha and PIL but it could get some errors while dowloading them so if automatic dependency resolution doesn't work use code above) and prepare plugin to be turned on in WebAdmin/plugins. Setup just installs TracDownloaderPlugin. If you like to use Captcha tests you have to install PIL and PyCaptcha manually either (note that PIL is in most Linux distributions package named python-imaging so you don't need to install it by easy install but you can use your package manager). Then you must enable both Downloader modules in TracAdmin/Plugins (or enable Downoader components in your envronment's ini file - source bottom) and assign some permissions of downloader to someone and you can start trying Downloader plug-in...
[components] tracdownloader.admin.downloaderadminpage = enabled tracdownloader.web_ui.downloadermodule = enabled
After steps above and clicking to any part of Downloader you should be asked about location of directory to store uploaded files. When it is set up, you must Submit that form two times and there can occur exception "DatabaseError: database schema has changed". If this exception is thrown, it's best to restart your http server.
Downloader keeps using ClearSilver as templating system so you have to have it installed (version for new templating system Genshe will be written soon). Version for Trac 0.11 wasn't too much tested so if you find errors, please write me a ticket as soon as possible.
If you had problems installing Downloader, please write me a ticket or write solution of your installation problems here.
Downloader plug-in defines three permissions:
DOWNLOADER_DOWNLOAD - lets user to download things from main part of plug-in, if you like to let all users download from donwloader, just get this permission to user anonymous.
DOWNLOADER_STATS - lets user to browse part of statistics in the main module of Downloader (user will be able to see links to statistics in the right top corner of the page).
DOWNLOADER_ADMIN - lets user to upload files, manage files, releases and categories, browse fill up's of questionnaire, delete fill up's of questionnaire and manage settings of Downloader plug-in. Note that this permission should never be given to user anonymous!
Downloader plug-in provides three types of wiki syntax for referencing of standalone files, whole releases or categories. Each syntax have two possible forms. If syntax is enclosed by  you can easily write your own title for item (file, release, category). If the syntax is separated just by spaces, there will be automatically created link with name of referenced item (file, release, category).
downloader:5 - Creates link to file with id 5 with it's name [downloader:5 click here] - Creates 'click here' link to file with id 5 downloaderrel:23 - Creates link to release with id 23 with it's name [downloaderrel:23 click here] - Creates 'click here' link to release with id 23 downloadercat:43 - Creates link to category with id 43 with it's name [downloadercat:43 click here] - Creates 'click here' link to category with id 43
If item of that id doesn't exist, there's diplayed only link to nowhere with title "id not found". If file was deleted, it still displays it's correct name, but link is to nowhere.
This features are availible only if you have Downloader installed in unzipped form (doesn't work in egg or zip file).
MIME list In tracdownloader directroy there is a file mime_list.txt which contains list of known MIME types for downloader, you can easily add new ones or delete unneeded, if there is no record found for particular file extension in this list, Downloader uses MIME of application/octet-stream.
EDIT QUESTIONNAIRE The file form_data.py contains structure used to generate questionnaire before download of file. You can easily edit this to get from users the data you exactly want. There is big decription inside of this file.
Reset all statistics
To clear all recorded data about dowloads and users who downloaded anything by DownloaderPlugin you can use on your Trac environment database these two SQL commands.
DELETE FROM downloader_downloaded_attributes; DELETE FROM downloader_downloaded;
That's all... After this all statistics are gone...
Fixed incorrect source code encoding (http://www.python.org/dev/peps/pep-0263/).
Refs #4299: Fixed setup.py syntax error for the 0.10 branch. The 0.10 branch won't be supported. This fix is untested.
Fixes #5540: Fixed encoding error in defining the navigation item for the INavigationContributor interface.
Fixes #8515: Syntax error in setup.py was preventing installation.
- 04_downloads.png (66.6 kB) -
Main list of Downloads, added by anonymous on 12/14/07 12:23:51.
- 01_files_admin.png (59.1 kB) -
Administration of files to download, added by firstname.lastname@example.org on 12/14/07 12:25:08.
- 02_settings_admin.png (51.8 kB) -
Settings of Downloader plug-in, added by peca on 12/14/07 12:26:34.
- 03_stats_admin.png (65.4 kB) -
Administration of statistics and questionnaire fill up's, added by peca on 12/14/07 12:27:38.
- 06_year_stats.png (38.4 kB) -
Statistics of downloads by years, added by peca on 12/14/07 12:28:11.
- 05_month_stats.png (39.3 kB) -
Statistics of downloads by months, added by peca on 12/14/07 12:28:43.
- 07_file_stats.png (42.5 kB) -
Statistics of files (releases and categories has this too), added by peca on 12/14/07 12:34:48.
- 08_questionnaire.png (81.8 kB) -
Questionnaire to get information about user who downloads, added by peca on 12/14/07 13:36:16.