horsemeat 2.23.0__tar.gz → 2.23.1__tar.gz
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.
- {horsemeat-2.23.0 → horsemeat-2.23.1}/PKG-INFO +1 -1
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/configwrapper.py +23 -11
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/version.py +1 -1
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/request.py +0 -22
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat.egg-info/PKG-INFO +1 -1
- {horsemeat-2.23.0 → horsemeat-2.23.1}/MANIFEST.in +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/README +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/__init__.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/model/__init__.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/model/newsmessage.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/model/session.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/model/user.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/pg.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/scripts/make-frippery-project +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/tests/__init__.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/tests/test_configwrapper.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/__init__.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/bogusrequest.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/dispatcher.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/framework_templates/__init__.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/frameworkhandlers.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/handler.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/response.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat/webapp/scrubber.py +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat.egg-info/SOURCES.txt +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat.egg-info/dependency_links.txt +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat.egg-info/requires.txt +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/horsemeat.egg-info/top_level.txt +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/requirements.txt +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/setup.cfg +0 -0
- {horsemeat-2.23.0 → horsemeat-2.23.1}/setup.py +0 -0
@@ -3,6 +3,7 @@
|
|
3
3
|
import abc
|
4
4
|
import contextlib
|
5
5
|
import datetime
|
6
|
+
import importlib
|
6
7
|
import json
|
7
8
|
import logging
|
8
9
|
import logging.config
|
@@ -17,7 +18,7 @@ import warnings
|
|
17
18
|
|
18
19
|
# import clepy
|
19
20
|
import jinja2
|
20
|
-
import pkg_resources
|
21
|
+
# import pkg_resources
|
21
22
|
import psycopg2, psycopg2.extras
|
22
23
|
import psycopg
|
23
24
|
import yaml
|
@@ -78,9 +79,11 @@ class ConfigWrapper(object):
|
|
78
79
|
|
79
80
|
else:
|
80
81
|
|
81
|
-
stream =
|
82
|
-
|
83
|
-
|
82
|
+
stream = importlib.resources.files(cls.configmodule).joinpath(filename).open()
|
83
|
+
|
84
|
+
# stream = pkg_resources.resource_stream(
|
85
|
+
# cls.configmodule,
|
86
|
+
# filename)
|
84
87
|
|
85
88
|
self = cls(
|
86
89
|
yaml.safe_load(stream),
|
@@ -106,9 +109,11 @@ class ConfigWrapper(object):
|
|
106
109
|
|
107
110
|
return self
|
108
111
|
|
109
|
-
elif pkg_resources.resource_exists(
|
110
|
-
cls.configmodule,
|
111
|
-
path_to_file):
|
112
|
+
# elif pkg_resources.resource_exists(
|
113
|
+
# cls.configmodule,
|
114
|
+
# path_to_file):
|
115
|
+
|
116
|
+
elif importlib.resources.files(cls.configmodule).joinpath(path_to_file).exists():
|
112
117
|
|
113
118
|
return cls.from_yaml_file_name(path_to_file)
|
114
119
|
|
@@ -250,7 +255,10 @@ class ConfigWrapper(object):
|
|
250
255
|
Add a config entry to use the fancy one.
|
251
256
|
"""
|
252
257
|
|
258
|
+
# Pretty quick, move to psycopg from psycopg2 but this is here
|
259
|
+
# until I get tests passing.
|
253
260
|
if self.config_dictionary["postgresql"].get("psycopg_version") != "psycopg":
|
261
|
+
1/0
|
254
262
|
return self.make_psycopg2_database_connection(register_composite_types=register_composite_types)
|
255
263
|
|
256
264
|
else:
|
@@ -293,13 +301,17 @@ class ConfigWrapper(object):
|
|
293
301
|
|
294
302
|
if isinstance(x, str):
|
295
303
|
|
296
|
-
warnings.warn("Stop it! Define logging configuration "
|
304
|
+
warnings.warn("Stop it! Define logging configuration in"
|
297
305
|
"the same YAML file!")
|
298
306
|
|
299
307
|
logging.config.fileConfig(
|
300
|
-
|
301
|
-
|
302
|
-
|
308
|
+
importlib.resources.files('horsemeat').joinpath("configs").joinpath("logging_configs"),
|
309
|
+
x)
|
310
|
+
|
311
|
+
# logging.config.fileConfig(
|
312
|
+
# pkg_resources.resource_filename(
|
313
|
+
# 'horsemeat.configs.logging_configs',
|
314
|
+
# x))
|
303
315
|
|
304
316
|
elif isinstance(x, dict):
|
305
317
|
logging.config.dictConfig(x)
|
@@ -537,28 +537,6 @@ class Request(collections.abc.MutableMapping):
|
|
537
537
|
else:
|
538
538
|
return 'UTF-8'
|
539
539
|
|
540
|
-
|
541
|
-
def get_binder_id(self):
|
542
|
-
|
543
|
-
if 'binder_id' in self:
|
544
|
-
return self['binder_id']
|
545
|
-
|
546
|
-
if 'binder_id' in self.wz_req.args:
|
547
|
-
self['binder_id'] = int(self.wz_req.args['binder_id'])
|
548
|
-
return self['binder_id']
|
549
|
-
|
550
|
-
elif 'binder_id' in self.wz_req.form:
|
551
|
-
self['binder_id'] = int(self.wz_req.form['binder_id'])
|
552
|
-
return self['binder_id']
|
553
|
-
|
554
|
-
elif self.global_session_data \
|
555
|
-
and 'binder_id' in self.global_session_data:
|
556
|
-
self['binder_id'] = self.global_session_data['binder_id']
|
557
|
-
return self['binder_id']
|
558
|
-
|
559
|
-
else:
|
560
|
-
raise ValueError('Sorry, could not figure out binder ID')
|
561
|
-
|
562
540
|
@property
|
563
541
|
def json(self):
|
564
542
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|