Changes between Version 41 and Version 42 of TracCronPlugin


Ignore:
Timestamp:
Feb 11, 2014, 1:45:04 PM (11 months ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracCronPlugin

    v41 v42  
    55== Description ==
    66
    7 This plugin add a scheduler inside Trac process that can handle any sort
    8 of task writing in python language. Main features are:
     7This plugin adds a scheduler inside the Trac process that can handle any sort
     8of task written in the python language. Main features are:
    99
    1010 * Task are plugin
     
    1616 * Task execution history '''new''' ''rss feed is available''
    1717
    18 The plugin provide an administration panel to help scheduling.
    19 
    20 [[Image(tcp_admin_panel.png, 640)]]
     18The plugin provides an administration panel to help scheduling.
     19
     20[[Image(tcp_admin_panel.png, 80%)]]
    2121
    2222== Bugs/Feature Requests ==
     
    5151== Example ==
    5252
    53 My company need to synchronize trac user with an external source of account. The job was made by an ETL but fine tuning of trac user was still done by a our modified version of Trac by clicking on a button on the admin panel that call a well designed API. So instead of manually clik on the button i searched a way to automate it. Unfortunately, i did not find any plugin for this and even if i could use a unix cron task or an windows AT command  to plane the task, i thought it would be better done inside Trac process.
    54 
    55 So if you have any function for entry point of a process (i mean trac related process) and you want to plane it as a job, Trac Cron Plugin is for you.
    56 
    57 Simply create in a module (.py) a class that implement the ICronTask and put it inside plugins directory. Then you can either trick the trac.ini either comfortably use the dedicated admin panel.
     53My company needed to synchronize trac users with an external account source. The job was done by an ETL but fine tuning of trac user was still done by a our modified version of Trac by clicking on a button on the admin panel that call a well designed API. So instead of manually clicking on the button I searched for a way to automate it. Unfortunately, I did not find any plugin for this and even if I could use a unix cron task or an windows AT command to plane the task, I thought it would be better done inside Trac process.
     54
     55So if you have any function for entry point of a process (I mean trac related process) and you want to plane it as a job, Trac Cron Plugin is for you.
     56
     57Simply create in a module (.py) a class that implements the ICronTask and put it inside the plugins directory. Then you can either trick the trac.ini either comfortably use the dedicated admin panel.
    5858
    5959=== How to write a task ===
    6060
    61 You have to write python class that inherit of ICronTask which code is below:
     61You have to write python class that inherits of ICronTask which code is below:
    6262{{{
    6363#!python
     
    112112}}}
    113113
    114 You need to implements the interface and to put the definition of the task inside the '''wake_up''' method
     114You need to implement the interface and to put the definition of the task inside the '''wake_up''' method
    115115
    116116=== How to install the task ===
    117117
    118 Since task are component you just have to put the class definition of your task in a python module in plugins directory.
     118Since tasks are components you just have to put the class definition of your task in a python module in the plugins directory.
    119119You can either create a .py file and put it in plugins directory or package the .py file into an eggs you'll leave in plugins directory.
    120120
     
    123123== Configuration ==
    124124
    125 The plugin can entirely be configured both witn trac.ini or administration panel.
     125The plugin can be entirely configured from either trac.ini or the administration panel.
    126126The section name of TracCronPlugin is traccron, here is a full sample
    127127
     
    173173}}}
    174174
    175 This is the second way to enable or disable a task. Since ''ticker_enabled'' is global and so all task will be affected, this key only affect one task. If False, wathever schedule the task have, no one will be trigged, so this is a way to disable a task while keep all the schedule in place for the time you will enable the task. Default is '''True'''.
     175This is the second way to enable or disable a task. Since ''ticker_enabled'' is global and so all task will be affected, this key only affect one task. If False, whatever schedule the task have, no one will be triggered, so this is a way to disable a task while keep all the schedule in place for the time you will enable the task. Default is '''True'''.
    176176
    177177
     
    191191}}}
    192192
    193 The goal of this scheduler is to trigger task every hours. You provode minute when you want the task to be executed. Accept comma sparated list of values. Default is no value.
     193The goal of this scheduler is to trigger task every hours. You provide minute when you want the task to be executed. Accept comma separated list of values. Default is no value.
    194194
    195195
     
    199199}}}
    200200
    201 This sceduler trigger task that need to be executed once a month. You provide the day in month and the hour when the task will be launched. The day is the index of the day starting at 1. Accept comma separated value. Default is no value
     201This scheduler trigger task that need to be executed once a month. You provide the day in month and the hour when the task will be launched. The day is the index of the day starting at 1. Accept comma separated value. Default is no value
    202202
    203203
     
    211211==== Enable/Disable a schedule ====
    212212
    213 Each schedule can individualy be enabled or disabled. This the configuration for daily scheduler:
     213Each schedule can individually be enabled or disabled. This the configuration for daily scheduler:
    214214
    215215{{{
     
    218218}}}
    219219
    220 This enable or disable the trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
     220This enables or disables the trigger. If False, the scheduler will not trigger the task. Default is '''True'''.
    221221
    222222==== Pass argument to a task ====
    223223
    224 You can pass argument to the task in a per schedule basis. Here an example for daily schedule:
     224You can pass arguments to the task on a per schedule basis. Here an example for daily schedule:
    225225
    226226{{{
     
    229229}}}
    230230
    231 When the daily schedule will trigger the task, the value of the key will be passed to the '''wake_up''' call. Parameters can be coma separated multiple value. Default is '''empty'''
     231When the daily schedule triggers the task, the value of the key is passed to the '''wake_up''' call. Parameters can be coma separated multiple value. Default is '''empty'''
    232232
    233233== Bundled Task ==
    234234
    235 Beside the HearBeat task provided for testing purpose, TracCronPlugin come with following useful task.
     235Besides the HearBeat task provided for testing purpose, TracCronPlugin comes with the following useful task.
    236236
    237237=== sleeping_ticket ===
    238238
    239 This task remind reporter about orphaned ticket and assigned user about sleeping ticket. Orphaned ticket is a ticket in new status since more than a given amount of day. An email notification is sent to the reporter in such a case. A sleeping ticket is a ticket assigned to an user, but the user either did not accept it or did not touch the ticket(make comment for example) since more than a given amount of day. The assigned user is notified in such a case. The delay is an optional parameter associated with each schedule. Default value is '''3 day'''.
     239This task reminds reporter about orphaned ticket and assigned user about sleeping ticket. An orphaned ticket is a ticket in new status since more than a given amount of day. An email notification is sent to the reporter in such a case. A sleeping ticket is a ticket assigned to an user, but the user either did not accept it or did not touch the ticket(make comment for example) since more than a given amount of day. The assigned user is notified in such a case. The delay is an optional parameter associated with each schedule. Default value is '''3 day'''.
    240240
    241241=== unreachable milestone ===
     
    263263
    264264
    265 Best regard.
     265Best regards.
    266266
    267267--