Changes between Version 49 and Version 50 of TracCronPlugin
- Timestamp:
- Jan 24, 2016, 9:33:46 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracCronPlugin
v49 v50 1 1 [[PageOutline(2-5,Contents,pullout)]] 2 2 3 = Trac Cron Plugin3 = Trac Cron task scheduler 4 4 5 5 == Description 6 6 7 This plugin adds a scheduler inside the Trac process that can handle any sort oftask written in the Python language. It allows you to have any function of a Trac related process to be added as a job.7 This plugin adds a scheduler inside the Trac process that can handle any task written in the Python language. It allows you to have any function of a Trac related process to be added as a job. 8 8 9 9 Key features: … … 32 32 Current stable release is '''0.3.1'''. 33 33 34 You can use easy_install or pipto download and install the latest package into your Python environment:34 You can use `easy_install` or `pip` to download and install the latest package into your Python environment: 35 35 {{{#!sh 36 36 easy_install TracCronPlugin … … 46 46 == Source 47 47 48 You can clone TracCronPlugin from [https://bitbucket.org/t2y/trac.plugins.traccron here] using Mercurial, or browse the source.48 You can browse the source or clone TracCronPlugin from [https://bitbucket.org/t2y/trac.plugins.traccron BitBucket] using Mercurial. 49 49 Originally, TracCronPlugin source is hosted in [/svn/traccronplugin trac-hacks.org svn], but is no longer maintained there. 50 50 51 51 == Example 52 52 53 Simply create in a module (.py) a class that implements the ICronTask and put it in the plugins directory. Then you can either modify the trac.ini or use the Trac cron admin panel.53 Simply create in a module (.py) a class that implements the ICronTask and put it in the plugins directory. Then you can either modify the trac.ini file or use the Trac cron admin panel. 54 54 55 55 === Writing a task 56 56 57 You have to write a Python class that inherits ICronTask:57 To implement a task you have to write a Python class that inherits ICronTask: 58 58 {{{#!python 59 59 class ICronTask(Interface): … … 111 111 112 112 Since tasks are components you just have to put the class definition of your task in a Python module in the plugins directory. 113 You can either create a .py file and put it in the plugins directory . Alternativelyyou can package the .py file into an egg and leave it in the plugins directory.114 115 TracCronPlugin will show upthe task in the administration panel.113 You can either create a .py file and put it in the plugins directory or you can package the .py file into an egg and leave it in the plugins directory. 114 115 TracCronPlugin will show the task in the administration panel. 116 116 117 117 == Configuration 118 118 119 The plugin can be entirely configured from either trac.ini orthe administration panel.119 The plugin can be entirely configured from either within the trac.ini file or from the administration panel. 120 120 The section name of TracCronPlugin is `traccron`, here is a full sample: 121 121 … … 170 170 }}} 171 171 172 The goal of this scheduler is to trigger the task every hour. Provide the minute when you want the task to be executed. Accept comma separated list ofvalues. Default is no value:172 The goal of this scheduler is to trigger the task every hour. Provide the minute when you want the task to be executed. Accepts comma separated values. Default is no value: 173 173 174 174 {{{#!ini … … 224 224 '''Note''': Since 0.2dev_r9388 225 225 226 This task scans still opened tickets in near milestone. Such a situation means that those tickets will probably not be part of the milestone. The task sends a mail touser defined with ''unreachable_milestone.recipient'' (default is '''empty''') for each milestone with the list of still opened tickets. You may want to set the value to the release manager user. Reporter and owner are notified too, but only for their tickets. The task looks for the nearest milestone until '''3 days ahead'''. You can change the value with parameter either by setting ''unreachable_milestone.<schedule>.arg'' or in the admin panel.226 This task scans still opened tickets in near milestone. Such a situation means that those tickets will probably not be part of the milestone. The task sends an email to the user defined with ''unreachable_milestone.recipient'' (default is '''empty''') for each milestone with the list of still opened tickets. You may want to set the value to the release manager user. Reporter and owner are notified too, but only for their tickets. The task looks for the nearest milestone until '''3 days ahead'''. You can change the value with parameter either by setting ''unreachable_milestone.<schedule>.arg'' or in the admin panel. 227 227 228 228 This is an example of the mail for release manager: … … 256 256 '''Note''': since 0.2dev_r9390. 257 257 258 Trac allows the administrator to postpone still opened ticket in a given milestone when he closes this milestone. But this is not mandatory. The auto postpone task will help to not forget opened tickets in a closed milestone. The task looks for such tickets and postpones them in the more recent still opened milestone. Milestone must have a due date.258 Trac allows the administrator to postpone still opened tickets in a given milestone when he closes this milestone. But this is not mandatory. The auto postpone task will help to not forget opened tickets in a closed milestone. The task looks for such tickets and postpones them in the more recent still opened milestone. Milestone must have a due date. 259 259 260 260 === Ticket deadline task … … 343 343 }}} 344 344 345 Please refer to cron documentation for more details [http://en.wikipedia.org/wiki/CRON_expression cron syntax].345 Please refer to cron documentation for more details on the standard [wikipedia:CRON_expression cron syntax]. 346 346 347 347 == Bundled Listener … … 349 349 === Email notification of task event 350 350 351 This listener notif y by email about task execution. You can choose the number of event sent by email by setting the value of ''email_task_event.limit''. When the listener has received at least the number of task execution, it will send the mail. Default is '''1'''. The value of ''email_task_event.recipient'' '''must''' be filled, otherwise nomail will be sent.351 This listener notifies by email about task execution. You can choose the number of event sent by email by setting the value of ''email_task_event.limit''. When the listener has received at least the number of task execution, it will send the email. Default is '''1'''. The value of ''email_task_event.recipient'' '''must''' be filled, otherwise no email will be sent. 352 352 353 353 Here is the configuration for this listener: