babyweb 0.1.2__py3-none-any.whl → 0.1.4__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 +25 -2
- babyweb/response.py +2 -1
- babyweb/version.py +1 -1
- {babyweb-0.1.2.dist-info → babyweb-0.1.4.dist-info}/METADATA +1 -1
- {babyweb-0.1.2.dist-info → babyweb-0.1.4.dist-info}/RECORD +8 -8
- {babyweb-0.1.2.dist-info → babyweb-0.1.4.dist-info}/LICENSE +0 -0
- {babyweb-0.1.2.dist-info → babyweb-0.1.4.dist-info}/WHEEL +0 -0
- {babyweb-0.1.2.dist-info → babyweb-0.1.4.dist-info}/top_level.txt +0 -0
babyweb/cron.py
CHANGED
|
@@ -98,15 +98,38 @@ class Cron(object):
|
|
|
98
98
|
|
|
99
99
|
def parse(self):
|
|
100
100
|
self.logger.info("parse")
|
|
101
|
+
schedule = None
|
|
102
|
+
active = True
|
|
101
103
|
url = None
|
|
104
|
+
notflag = " is not "
|
|
105
|
+
versep = lambda negate : notflag if negate else " is "
|
|
102
106
|
for line in read("cron.yaml", True):
|
|
103
107
|
if line.startswith("- description: "):
|
|
104
108
|
self.logger.info("initializing %s"%(line[15:],))
|
|
105
109
|
elif line.startswith(" url: "):
|
|
106
110
|
url = line[7:].strip()
|
|
111
|
+
elif line.startswith(" schedule: "):
|
|
112
|
+
schedule = line[12:].strip()
|
|
113
|
+
elif line.startswith(" active: "):
|
|
114
|
+
condition = line[10:].strip()
|
|
115
|
+
if condition == "True":
|
|
116
|
+
active = True
|
|
117
|
+
elif condition == "False":
|
|
118
|
+
active = False
|
|
119
|
+
else:
|
|
120
|
+
negate = notflag in condition
|
|
121
|
+
name, tar = condition.split(versep(negate))
|
|
122
|
+
val = os.getenv(name)
|
|
123
|
+
matching = val == tar
|
|
124
|
+
active = not matching if negate else matching
|
|
125
|
+
self.logger.info("setting active to %s because '%s' %s '%s'"%(active,
|
|
126
|
+
val, versep(not matching), tar))
|
|
107
127
|
elif url:
|
|
108
|
-
|
|
109
|
-
url
|
|
128
|
+
if active:
|
|
129
|
+
self.timers[url] = Rule(self.controller, self.scheduler,
|
|
130
|
+
url, schedule, self.logger_getter)
|
|
131
|
+
schedule = None
|
|
132
|
+
active = True
|
|
110
133
|
url = None
|
|
111
134
|
|
|
112
135
|
def start(self):
|
babyweb/response.py
CHANGED
|
@@ -10,6 +10,7 @@ def read_file(data_field):
|
|
|
10
10
|
|
|
11
11
|
class Response(object):
|
|
12
12
|
def __init__(self, request):
|
|
13
|
+
self.noabort = False
|
|
13
14
|
self.id = request.id
|
|
14
15
|
self.ip = request.real_ip
|
|
15
16
|
self.request = request
|
|
@@ -52,7 +53,7 @@ class Response(object):
|
|
|
52
53
|
|
|
53
54
|
def _close(self):
|
|
54
55
|
timeout(.001, self.response.dispatch)
|
|
55
|
-
abort_branch()
|
|
56
|
+
self.noabort or abort_branch()
|
|
56
57
|
|
|
57
58
|
def _header(self, *args, **kwargs):
|
|
58
59
|
self.response.__setitem__(*args, **kwargs)
|
babyweb/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.
|
|
1
|
+
__version__ = "0.1.4"
|
|
@@ -1,25 +1,25 @@
|
|
|
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=Z-J_MED7YP8ogx-oYObYt5uEMY2gE24ujrzLZoarDeM,5243
|
|
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
|
|
8
8
|
babyweb/memcache.py,sha256=W6JWcBjJPZx8RPYQXYRbCWMl-ziwy9OtzCvxV9RlCXs,484
|
|
9
9
|
babyweb/requesters.py,sha256=dpkw94d5UbRkEIBwShLQk98571VIP-SI9sSFww3MXtg,3523
|
|
10
|
-
babyweb/response.py,sha256=
|
|
10
|
+
babyweb/response.py,sha256=W5oZsTlUUSee3KeDQDG1QgSNiFx_z96HaNKDogNgtes,2373
|
|
11
11
|
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=JMD28FXYHc_TM03visyUSd3UA9FZAaJMRStnfZoq50Y,21
|
|
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.dist-info/LICENSE,sha256=TCGFq2RZnPZed3cKBhfq8EIxNzHcwJWJsBW8p9y1dDk,1068
|
|
22
|
+
babyweb-0.1.4.dist-info/METADATA,sha256=rTVEA11lDwW4fGAEMaye-tgpFKKnWd3OTWPJL047U-A,760
|
|
23
|
+
babyweb-0.1.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
24
|
+
babyweb-0.1.4.dist-info/top_level.txt,sha256=-KcZVMe9-tSS5gwyDZGyLvU5bemV6aWTSofb0B37Mts,8
|
|
25
|
+
babyweb-0.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|