summaryrefslogtreecommitdiffstats
path: root/collective.buildbot.multiple.patch (plain)
blob: e9d46cc20ad8d2ae5c8f1a8f2448229902b40e34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Index: CHANGES.txt
===================================================================
--- CHANGES.txt	(révision 86647)
+++ CHANGES.txt	(copie de travail)
@@ -1,6 +1,7 @@
 0.3.5 SVN/Unreleased
 ====================
 
+    - add support for cron multiple values ('1 2,3,4 * * * ')
 
 0.3.4 (2009-05-21)
 ====================
Index: collective/buildbot/project.py
===================================================================
--- collective/buildbot/project.py	(révision 86647)
+++ collective/buildbot/project.py	(copie de travail)
@@ -187,11 +187,20 @@
         cron = self.options.get('cron_scheduler', None)
         if cron is not None:
             try:
-                minute, hour, dom, month, dow = [v=='*' and v or int(v)
-                                                 for v in cron.split()[:5]]
+                minute, hour, dom, month, dow = cron.split()[:5]
+                timeline = {'minute': minute,
+                            'hour': hour,
+                            'dom': dom,
+                            'month': month,
+                            'dow': dow}
+                for var in timeline:
+                    if not '*' in timeline[var]:
+                        timeline[var] = [int(v) for v in timeline[var].split(',')]
                 name = 'Cron scheduler for %s at %s' % (self.name, cron)
                 self.schedulers.append(Nightly(
-                        name, self.builders(), minute, hour, dom, month, dow))
+                    name, self.builders(), 
+                    minute=timeline['minute'], hour=timeline['hour'], 
+                    dayOfMonth=timeline['month'], month=timeline['month'], dayOfWeek=timeline['dow'],))
 
             except (IndexError, ValueError, TypeError):
                 log.msg('Invalid cron definition for the cron '
Index: CONTRIBUTORS.txt
===================================================================
--- CONTRIBUTORS.txt	(révision 86647)
+++ CONTRIBUTORS.txt	(copie de travail)
@@ -13,3 +13,4 @@
  - Jean-Francois Roche
  - Mustapha Benali [mustapha]
  - Sylvain Viollon [thefunny]
+ - Mathieu Pasquet [kiorky]