babyweb 0.1.3__py3-none-any.whl → 0.1.4.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- babyweb/cron.py +29 -2
- babyweb/version.py +1 -1
- {babyweb-0.1.3.dist-info → babyweb-0.1.4.1.dist-info}/METADATA +1 -1
- {babyweb-0.1.3.dist-info → babyweb-0.1.4.1.dist-info}/RECORD +7 -7
- {babyweb-0.1.3.dist-info → babyweb-0.1.4.1.dist-info}/LICENSE +0 -0
- {babyweb-0.1.3.dist-info → babyweb-0.1.4.1.dist-info}/WHEEL +0 -0
- {babyweb-0.1.3.dist-info → babyweb-0.1.4.1.dist-info}/top_level.txt +0 -0
babyweb/cron.py
CHANGED
|
@@ -96,18 +96,45 @@ class Cron(object):
|
|
|
96
96
|
self.parse()
|
|
97
97
|
self.start()
|
|
98
98
|
|
|
99
|
+
def set(self, url, schedule):
|
|
100
|
+
self.logger.info("set %s : %s"%(url, schedule))
|
|
101
|
+
self.timers[url] = Rule(self.controller, self.scheduler,
|
|
102
|
+
url, schedule, self.logger_getter)
|
|
103
|
+
|
|
99
104
|
def parse(self):
|
|
100
105
|
self.logger.info("parse")
|
|
106
|
+
schedule = None
|
|
107
|
+
active = True
|
|
101
108
|
url = None
|
|
109
|
+
notflag = " is not "
|
|
110
|
+
versep = lambda negate : notflag if negate else " is "
|
|
102
111
|
for line in read("cron.yaml", True):
|
|
103
112
|
if line.startswith("- description: "):
|
|
104
113
|
self.logger.info("initializing %s"%(line[15:],))
|
|
105
114
|
elif line.startswith(" url: "):
|
|
106
115
|
url = line[7:].strip()
|
|
116
|
+
elif line.startswith(" schedule: "):
|
|
117
|
+
schedule = line[12:].strip()
|
|
118
|
+
elif line.startswith(" active: "):
|
|
119
|
+
condition = line[10:].strip()
|
|
120
|
+
if condition == "True":
|
|
121
|
+
active = True
|
|
122
|
+
elif condition == "False":
|
|
123
|
+
active = False
|
|
124
|
+
else:
|
|
125
|
+
negate = notflag in condition
|
|
126
|
+
name, tar = condition.split(versep(negate))
|
|
127
|
+
val = os.getenv(name)
|
|
128
|
+
matching = val == tar
|
|
129
|
+
active = not matching if negate else matching
|
|
130
|
+
self.logger.info("setting active to %s because '%s' %s '%s'"%(active,
|
|
131
|
+
val, versep(not matching), tar))
|
|
107
132
|
elif url:
|
|
108
|
-
|
|
109
|
-
|
|
133
|
+
active and self.set(url, schedule)
|
|
134
|
+
schedule = None
|
|
135
|
+
active = True
|
|
110
136
|
url = None
|
|
137
|
+
active and url and self.set(url, schedule) # if no trailing line break
|
|
111
138
|
|
|
112
139
|
def start(self):
|
|
113
140
|
self.logger.info("start")
|
babyweb/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.4.1"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
babyweb/__init__.py,sha256=ePOo3Lx3DdhdOrDMae2PHhOLr8SqNh81c2wN0h5JRNQ,404
|
|
2
2
|
babyweb/config.py,sha256=65zhbGr65GCpJR_lRpaQDVj_VODQzbu8-6RGXcRVnWU,1093
|
|
3
3
|
babyweb/controller.py,sha256=zuP_h0y9o2G98QVp_DqtgPDPOJIzGARizQzG5Aozv-g,2734
|
|
4
|
-
babyweb/cron.py,sha256=
|
|
4
|
+
babyweb/cron.py,sha256=hcKIHxbW6y1wkasoEv64nnstdJYURcVMOpGE-xPrFRw,5413
|
|
5
5
|
babyweb/daemons.py,sha256=YbTVcyG7xlOm1LFtJcsFGIGsV1I-jjjn_byqMPSPnQI,1886
|
|
6
6
|
babyweb/logger.py,sha256=evX96jubM5UlF20-1v83Z0rqKnSPDjIYkiE75YUlD1c,1083
|
|
7
7
|
babyweb/mail.py,sha256=A7FL99zDU9Y_LAZPpw9-LWOsxuc1eoiGMN1EYVrwOIo,607
|
|
@@ -12,14 +12,14 @@ babyweb/routes.py,sha256=V9EQKjWqbwWrR1t4Ren9IGAcmcS5awYCIHdseWoEqVU,483
|
|
|
12
12
|
babyweb/server.py,sha256=l1Co447w-Ef3Tlu0sj_cERRbvSS_GCbaTkHhfsJrJh8,1561
|
|
13
13
|
babyweb/shield.py,sha256=uB4vDKf6jKwWIebAjitm_q9T86iKPRKPNNeKcPgLfrE,1551
|
|
14
14
|
babyweb/sms.py,sha256=lYQFgpFjAas1XIolE0QC4ro2wgXH7hruzV1Dxz72-sE,299
|
|
15
|
-
babyweb/version.py,sha256=
|
|
15
|
+
babyweb/version.py,sha256=fQUBvf7OL9l_W8MpeA-RNauH5MKF5nQgCHeDrXVCM30,23
|
|
16
16
|
babyweb/util/__init__.py,sha256=LWPdEVAVSq9NE7SHH434tlb517B4DfUFIWAc25QECI8,357
|
|
17
17
|
babyweb/util/converters.py,sha256=SfGPkBFK1GBm085WdtUjskXK0Y_j8yRs7UC_aeLIOmg,1541
|
|
18
18
|
babyweb/util/loaders.py,sha256=wD9H9pB6HWAB41i7oTNfxaKd7BOV9p4oNHu4F5-ilkk,1597
|
|
19
19
|
babyweb/util/responders.py,sha256=w_STmdUvdB9seOxOV0v-WAFUrqVrlUtuqoLRG-QugLI,6195
|
|
20
20
|
babyweb/util/setters.py,sha256=xIHtdLQgdlyCUC83q3ZW8ab6U5Rj3UU6ZgK70b-TOg4,337
|
|
21
|
-
babyweb-0.1.
|
|
22
|
-
babyweb-0.1.
|
|
23
|
-
babyweb-0.1.
|
|
24
|
-
babyweb-0.1.
|
|
25
|
-
babyweb-0.1.
|
|
21
|
+
babyweb-0.1.4.1.dist-info/LICENSE,sha256=TCGFq2RZnPZed3cKBhfq8EIxNzHcwJWJsBW8p9y1dDk,1068
|
|
22
|
+
babyweb-0.1.4.1.dist-info/METADATA,sha256=eiMosOs9MAbnDKBeWITxY-Pq2DGO_yhP7EDiDVE9brE,762
|
|
23
|
+
babyweb-0.1.4.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
24
|
+
babyweb-0.1.4.1.dist-info/top_level.txt,sha256=-KcZVMe9-tSS5gwyDZGyLvU5bemV6aWTSofb0B37Mts,8
|
|
25
|
+
babyweb-0.1.4.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|