Changes between Version 2 and Version 3 of TracSchedulerPlugin


Ignore:
Timestamp:
Oct 16, 2008 5:20:54 AM (6 years ago)
Author:
richard
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracSchedulerPlugin

    v2 v3  
    55== Description == 
    66 
    7  * Poll tasks which register to schedule manager and run match tasks 
    8   
     7This plugin provides an extension point for trac plugin developers to manager their scheduled taskes. It polls register plugins, and run matched tasks like '''crontab''' in linux/unix. 
     8 
     9Features will be added to this plugin in next version: 
     10 * support crontab format 
    911 
    1012== Bugs/Feature Requests ==  
     
    2426You can check out TracSchedulerPlugin from [http://trac-hacks.org/svn/tracschedulerplugin here] using Subversion, or [source:tracschedulerplugin browse the source] with Trac. 
    2527 
     28== Install == 
     29 You can install this software as normal Trac plugin. 
     30 
     31 1. Uninstall Trac Scheduler if you have installed before. 
     32 
     33 2. Change to the directory containning setup.py. 
     34 
     35 3. If you want to install this plugin globally, that will install this plugin to the python path: 
     36  * python setup.py install 
     37 
     38 4. If you want to install this plugin to trac instance only: 
     39  * python setup.py bdist_egg 
     40  * copy the generated egg file to the trac instance's plugin directory 
     41  {{{ 
     42cp dist/*.egg /srv/trac/env/plugins 
     43}}} 
     44 
     45 5. Config trac.ini: 
     46  {{{ 
     47[components] 
     48tracscheduler.* = enabled 
     49 
     50[tracscheduler] 
     51; tasks poll interval is 60 sec 
     52poll_interval = 60 
     53; task invoke interval is 1 sec 
     54worker_interval = 1 
     55}}} 
     56 
    2657== Example == 
    2758 
    28 TBD 
     59This following plugin will logging the latest 2 ticket ids every 1 minute. 
     60 
     61{{{ 
     62from tracscheduler.web_ui import IScheduledTask 
     63 
     64class TracSchedulerTest(Component): 
     65    implements(IScheduledTask) 
     66    def process_scheduled_task(self, parent): 
     67        self.log.debug("TracSchedulerTest") 
     68        sqlString = "SELECT id FROM ticket ORDER BY id DESC LIMIT 2;" 
     69        rows = parent.queryDb(sqlString) 
     70        self.log.debug(rows) 
     71 
     72}}} 
    2973 
    3074== Recent Changes ==