babyweb 0.1.1.6__py3-none-any.whl → 0.1.1.8__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/config.py +4 -0
- babyweb/daemons.py +0 -2
- babyweb/requesters.py +13 -1
- babyweb/version.py +1 -1
- {babyweb-0.1.1.6.dist-info → babyweb-0.1.1.8.dist-info}/METADATA +2 -2
- {babyweb-0.1.1.6.dist-info → babyweb-0.1.1.8.dist-info}/RECORD +9 -9
- {babyweb-0.1.1.6.dist-info → babyweb-0.1.1.8.dist-info}/LICENSE +0 -0
- {babyweb-0.1.1.6.dist-info → babyweb-0.1.1.8.dist-info}/WHEEL +0 -0
- {babyweb-0.1.1.6.dist-info → babyweb-0.1.1.8.dist-info}/top_level.txt +0 -0
babyweb/config.py
CHANGED
|
@@ -12,6 +12,10 @@ config = Config({
|
|
|
12
12
|
"tracemalloc": False,
|
|
13
13
|
"allow": ["info", "log", "warn", "error"] # access,info,log,warn,error,detail,db,query,kernel
|
|
14
14
|
},
|
|
15
|
+
"proxy": { # user, gateway, minport, maxport
|
|
16
|
+
"active": False,
|
|
17
|
+
"proto": "https"
|
|
18
|
+
},
|
|
15
19
|
"mail": {
|
|
16
20
|
"mailer": None,
|
|
17
21
|
"name": None,
|
babyweb/daemons.py
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import sys
|
|
2
1
|
from dez.memcache import get_memcache
|
|
3
2
|
from dez.http.application import HTTPApplication
|
|
4
3
|
from .logger import logger_getter
|
|
5
4
|
from .routes import static, cb
|
|
6
5
|
from .config import config
|
|
7
|
-
sys.path.insert(0, ".") # for dynamically loading modules
|
|
8
6
|
|
|
9
7
|
class WebBase(HTTPApplication):
|
|
10
8
|
def __init__(self, bind_address, port, logger_getter, static=static, cb=cb, whitelist=[], blacklist=[], shield=False, mempad=0):
|
babyweb/requesters.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import time,
|
|
1
|
+
import time, json, random, requests
|
|
2
2
|
from dez.http import fetch as dfetch, post as dpost
|
|
3
3
|
from fyg.util import log
|
|
4
4
|
from .util import rec_conv, dec
|
|
5
|
+
from .config import config
|
|
5
6
|
|
|
6
7
|
def _ctjson(result):
|
|
7
8
|
if hasattr(result, "decode"):
|
|
@@ -85,8 +86,19 @@ def _dosyncreq(requester, url, asjson, ctjson, rekwargs):
|
|
|
85
86
|
return _ctjson(result)
|
|
86
87
|
return asjson and json.loads(result) or result
|
|
87
88
|
|
|
89
|
+
def getprox():
|
|
90
|
+
pcfg = config.proxy
|
|
91
|
+
prox = "http://%s:%s@%s:%s"%(pcfg.user, config.cache("proxy pw? "),
|
|
92
|
+
pcfg.gateway, random.randint(pcfg.minport, pcfg.maxport))
|
|
93
|
+
return {
|
|
94
|
+
"http": prox,
|
|
95
|
+
"https": prox
|
|
96
|
+
}
|
|
97
|
+
|
|
88
98
|
def syncreq(url, method="get", asjson=False, ctjson=False, retries=5, rekwargs={}):
|
|
89
99
|
attempt = 1
|
|
100
|
+
if config.proxy.active:
|
|
101
|
+
rekwargs["proxies"] = getprox()
|
|
90
102
|
requester = getattr(requests, method)
|
|
91
103
|
while attempt < retries:
|
|
92
104
|
try:
|
babyweb/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.1.1.
|
|
1
|
+
__version__ = "0.1.1.8"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: babyweb
|
|
3
|
-
Version: 0.1.1.
|
|
3
|
+
Version: 0.1.1.8
|
|
4
4
|
Summary: Basic Asynchronous weB librarY
|
|
5
5
|
Author: Mario Balibrera
|
|
6
6
|
Author-email: mario.balibrera@gmail.com
|
|
@@ -15,6 +15,6 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
|
15
15
|
License-File: LICENSE
|
|
16
16
|
Requires-Dist: dez >=0.10.10.42
|
|
17
17
|
Requires-Dist: fyg >=0.1.7.8
|
|
18
|
-
Requires-Dist: requests >=2.
|
|
18
|
+
Requires-Dist: requests >=2.28.1
|
|
19
19
|
|
|
20
20
|
repackages async dez components like HTTPApplication and SocketController into a minimalist config-driven web (backend) framework
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
babyweb/__init__.py,sha256=ePOo3Lx3DdhdOrDMae2PHhOLr8SqNh81c2wN0h5JRNQ,404
|
|
2
|
-
babyweb/config.py,sha256=
|
|
2
|
+
babyweb/config.py,sha256=zu14TnxD908uko6wvU8kEiW9c9oBUuwYX4G27CqY0sc,1113
|
|
3
3
|
babyweb/controller.py,sha256=zuP_h0y9o2G98QVp_DqtgPDPOJIzGARizQzG5Aozv-g,2734
|
|
4
4
|
babyweb/cron.py,sha256=wQTtY3ZJBeTjvQFbMDmR83c-aQjfEmulzeBWKUob55E,4243
|
|
5
|
-
babyweb/daemons.py,sha256=
|
|
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
|
-
babyweb/requesters.py,sha256=
|
|
9
|
+
babyweb/requesters.py,sha256=kbHMjTKiyTx9GNUXA0jzIw6Zl7WdkhjA0O7dcZ7W77A,3507
|
|
10
10
|
babyweb/response.py,sha256=_2hY9ib39MG59nvLDKD37pNCFF9ENuydegBQsd0KV18,2328
|
|
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=FnV2gpB-PedoIZdfXcMs0MLFEtieDxV22eux3IJE5sg,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.1.
|
|
22
|
-
babyweb-0.1.1.
|
|
23
|
-
babyweb-0.1.1.
|
|
24
|
-
babyweb-0.1.1.
|
|
25
|
-
babyweb-0.1.1.
|
|
21
|
+
babyweb-0.1.1.8.dist-info/LICENSE,sha256=TCGFq2RZnPZed3cKBhfq8EIxNzHcwJWJsBW8p9y1dDk,1068
|
|
22
|
+
babyweb-0.1.1.8.dist-info/METADATA,sha256=urVb0ywiVp1jYTQ5EOuBujsrA1KTv5sCwYXDy3Qd3HU,762
|
|
23
|
+
babyweb-0.1.1.8.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
|
24
|
+
babyweb-0.1.1.8.dist-info/top_level.txt,sha256=-KcZVMe9-tSS5gwyDZGyLvU5bemV6aWTSofb0B37Mts,8
|
|
25
|
+
babyweb-0.1.1.8.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|