chellow 1690534443.0.0__py3-none-any.whl → 1690551015.0.0__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.
Potentially problematic release.
This version of chellow might be problematic. Click here for more details.
chellow/e/hh_importer.py
CHANGED
|
@@ -99,16 +99,19 @@ def start_hh_import_process(dc_contract_id, istream, file_name, file_size):
|
|
|
99
99
|
return process
|
|
100
100
|
|
|
101
101
|
|
|
102
|
+
lock = threading.RLock()
|
|
103
|
+
|
|
104
|
+
|
|
102
105
|
class HhImportTask(threading.Thread):
|
|
103
106
|
def __init__(self, contract_id):
|
|
104
107
|
super().__init__(name=f"HH Automatic Import: contract {contract_id}")
|
|
105
|
-
self.lock = threading.RLock()
|
|
106
108
|
self.messages = deque()
|
|
107
109
|
self.contract_id = contract_id
|
|
108
110
|
self.importer = None
|
|
109
111
|
self.stopped = threading.Event()
|
|
110
112
|
self.going = threading.Event()
|
|
111
113
|
self.is_error = False
|
|
114
|
+
self.wait_seconds = 30 * 60
|
|
112
115
|
|
|
113
116
|
def stop(self):
|
|
114
117
|
self.stopped.set()
|
|
@@ -118,8 +121,8 @@ class HhImportTask(threading.Thread):
|
|
|
118
121
|
self.going.set()
|
|
119
122
|
|
|
120
123
|
def is_locked(self):
|
|
121
|
-
if
|
|
122
|
-
|
|
124
|
+
if lock.acquire(False):
|
|
125
|
+
lock.release()
|
|
123
126
|
return False
|
|
124
127
|
else:
|
|
125
128
|
return True
|
|
@@ -138,7 +141,6 @@ class HhImportTask(threading.Thread):
|
|
|
138
141
|
|
|
139
142
|
def import_file(self, sess):
|
|
140
143
|
found_new = False
|
|
141
|
-
self.wait_seconds = 30 * 60
|
|
142
144
|
|
|
143
145
|
try:
|
|
144
146
|
contract = Contract.get_dc_by_id(sess, self.contract_id)
|
|
@@ -173,7 +175,7 @@ class HhImportTask(threading.Thread):
|
|
|
173
175
|
return found_new
|
|
174
176
|
|
|
175
177
|
def import_now(self):
|
|
176
|
-
if
|
|
178
|
+
if lock.acquire(False):
|
|
177
179
|
sess = None
|
|
178
180
|
try:
|
|
179
181
|
sess = Session()
|
|
@@ -185,7 +187,7 @@ class HhImportTask(threading.Thread):
|
|
|
185
187
|
finally:
|
|
186
188
|
if sess is not None:
|
|
187
189
|
sess.close()
|
|
188
|
-
|
|
190
|
+
lock.release()
|
|
189
191
|
|
|
190
192
|
def run(self):
|
|
191
193
|
while not self.stopped.isSet():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1690551015.0.0
|
|
4
4
|
Summary: Web Application for checking UK energy bills.
|
|
5
5
|
Project-URL: Homepage, https://github.com/WessexWater/chellow
|
|
6
6
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
@@ -22,7 +22,7 @@ chellow/e/computer.py,sha256=P-8ZaLnD5GrAKkzuuLs314Ci-umszNuvYK03HysYkeA,66311
|
|
|
22
22
|
chellow/e/dno_rate_parser.py,sha256=3IqGM2v6Str7S3Rc9FZ7lRWBKthfb3zSjpJLSETPcEE,20631
|
|
23
23
|
chellow/e/duos.py,sha256=SLP2KpHlllMBMNzE70u0V3SHnScxWNOLQMjat28mu8U,29089
|
|
24
24
|
chellow/e/energy_management.py,sha256=AnmaWsYqX4RTisqXx8AuWJJ_QG9vKy_GXEAFVYVaJ5M,11490
|
|
25
|
-
chellow/e/hh_importer.py,sha256=
|
|
25
|
+
chellow/e/hh_importer.py,sha256=xnonyt-XkxF04EzBeno_Xk0t5IAA_5zlJfikcHw-7Wc,16435
|
|
26
26
|
chellow/e/hh_parser_bg_csv.py,sha256=IOjM-QliKzvSXyhslmxz504XWnsGkVKEaCQ48SNeNeQ,2423
|
|
27
27
|
chellow/e/hh_parser_df2.py,sha256=G4kt4N4mNjUa1Z7B1Ov6rAyZmWDyGEVFYscdghToMRo,3558
|
|
28
28
|
chellow/e/hh_parser_simple_csv.py,sha256=lVRprIEjDpTQdeXm2xcLmRAyre2LWec8ueVwcCISZPo,2082
|
|
@@ -352,6 +352,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
|
|
|
352
352
|
chellow/templates/g/supply_notes.html,sha256=WR3YwGh_qqTklSJ7JqWX6BKBc9rk_jMff4RiWZiF2CM,936
|
|
353
353
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
354
354
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
355
|
-
chellow-
|
|
356
|
-
chellow-
|
|
357
|
-
chellow-
|
|
355
|
+
chellow-1690551015.0.0.dist-info/METADATA,sha256=I9OVq5ATkHIdFjol7NTWY6hXK92bC0sFRL_18NFzduA,12161
|
|
356
|
+
chellow-1690551015.0.0.dist-info/WHEEL,sha256=9QBuHhg6FNW7lppboF2vKVbCGTVzsFykgRQjjlajrhA,87
|
|
357
|
+
chellow-1690551015.0.0.dist-info/RECORD,,
|
|
File without changes
|