chellow 1724313988.0.0__py3-none-any.whl → 1724334398.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/dloads.py +10 -4
- chellow/reports/report_csv_site_hh_data.py +26 -24
- {chellow-1724313988.0.0.dist-info → chellow-1724334398.0.0.dist-info}/METADATA +1 -1
- {chellow-1724313988.0.0.dist-info → chellow-1724334398.0.0.dist-info}/RECORD +5 -5
- {chellow-1724313988.0.0.dist-info → chellow-1724334398.0.0.dist-info}/WHEEL +0 -0
chellow/dloads.py
CHANGED
|
@@ -25,17 +25,23 @@ def startup(instance_path, run_deleter=True):
|
|
|
25
25
|
global download_id
|
|
26
26
|
global download_path
|
|
27
27
|
|
|
28
|
-
if run_deleter:
|
|
29
|
-
file_deleter = FileDeleter()
|
|
30
|
-
file_deleter.start()
|
|
31
|
-
|
|
32
28
|
download_path = instance_path / "downloads"
|
|
33
29
|
download_path.mkdir(parents=True, exist_ok=True)
|
|
34
30
|
|
|
31
|
+
# Delete any files marked RUNNING that are hanging around
|
|
32
|
+
for fl in download_path.iterdir():
|
|
33
|
+
if fl.name[SERIAL_DIGITS:].startswith("_RUNNING_"):
|
|
34
|
+
new_name = fl.name.replace("_RUNNING_", "_INTERRUPTED_", 1)
|
|
35
|
+
fl.rename(fl.parent / new_name)
|
|
36
|
+
|
|
35
37
|
dirs = sorted(download_path.iterdir(), reverse=True)
|
|
36
38
|
if len(dirs) > 0:
|
|
37
39
|
download_id = int(dirs[0].name[:SERIAL_DIGITS]) + 1
|
|
38
40
|
|
|
41
|
+
if run_deleter:
|
|
42
|
+
file_deleter = FileDeleter()
|
|
43
|
+
file_deleter.start()
|
|
44
|
+
|
|
39
45
|
|
|
40
46
|
class DloadFile:
|
|
41
47
|
def __init__(self, running_name, finished_name, mode, newline, is_zip):
|
|
@@ -5,7 +5,7 @@ import traceback
|
|
|
5
5
|
|
|
6
6
|
from flask import g, request
|
|
7
7
|
|
|
8
|
-
from sqlalchemy import null, or_, true
|
|
8
|
+
from sqlalchemy import null, or_, select, true
|
|
9
9
|
from sqlalchemy.orm import joinedload
|
|
10
10
|
|
|
11
11
|
from chellow.dloads import open_file
|
|
@@ -25,36 +25,38 @@ def content(start_date, finish_date, site_id, user_id):
|
|
|
25
25
|
writer = csv.writer(f, lineterminator="\n")
|
|
26
26
|
write_row(
|
|
27
27
|
writer,
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
28
|
+
"site_id",
|
|
29
|
+
"site_name",
|
|
30
|
+
"associated_site_ids",
|
|
31
|
+
"sources",
|
|
32
|
+
"generator_types",
|
|
33
|
+
"hh_start_clock_time",
|
|
34
|
+
"imported_kwh",
|
|
35
|
+
"displaced_kwh",
|
|
36
|
+
"exported_kwh",
|
|
37
|
+
"used_kwh",
|
|
38
|
+
"parasitic_kwh",
|
|
39
|
+
"generated_kwh",
|
|
40
|
+
"3rd_party_import",
|
|
41
|
+
"3rd_party_export",
|
|
42
|
+
"meter_type",
|
|
43
43
|
)
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
sites_q = select(Site).order_by(Site.code)
|
|
46
46
|
if site_id is not None:
|
|
47
|
-
|
|
47
|
+
sites_q = sites_q.where(Site.id == site_id)
|
|
48
48
|
|
|
49
|
-
for site in
|
|
49
|
+
for site in sess.scalars(sites_q):
|
|
50
50
|
sources = set()
|
|
51
51
|
generator_types = set()
|
|
52
52
|
assoc = site.find_linked_sites(sess, start_date, finish_date)
|
|
53
53
|
metering_type = ""
|
|
54
|
-
for era in (
|
|
55
|
-
|
|
54
|
+
for era in sess.scalars(
|
|
55
|
+
select(Era)
|
|
56
56
|
.join(SiteEra)
|
|
57
|
-
.
|
|
57
|
+
.join(Supply)
|
|
58
|
+
.join(Source)
|
|
59
|
+
.where(
|
|
58
60
|
SiteEra.site == site,
|
|
59
61
|
SiteEra.is_physical == true(),
|
|
60
62
|
Era.start_date <= finish_date,
|
|
@@ -90,9 +92,9 @@ def content(start_date, finish_date, site_id, user_id):
|
|
|
90
92
|
sources_str,
|
|
91
93
|
generators_str,
|
|
92
94
|
hh["start_date"],
|
|
93
|
-
hh["
|
|
95
|
+
hh["imp_grid"],
|
|
94
96
|
hh["displaced"],
|
|
95
|
-
hh["
|
|
97
|
+
hh["exp_grid"],
|
|
96
98
|
hh["used"],
|
|
97
99
|
hh["exp_gen"],
|
|
98
100
|
hh["imp_gen"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1724334398.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)
|
|
@@ -2,7 +2,7 @@ chellow/__init__.py,sha256=A6gh-jVJBhuCFmfquLEa8uf-kQhsRSFficE1SlnHnAg,10200
|
|
|
2
2
|
chellow/api.py,sha256=mk17TfweR76DPFC8lX2SArTjai6y6YshASxqO1w-_-s,11036
|
|
3
3
|
chellow/bank_holidays.py,sha256=T_utYMwe_g1dz5X-aOTdIPryg49SvB7QsWM1yphlqG8,4423
|
|
4
4
|
chellow/commands.py,sha256=ESBe9ZWj1c3vdZgqMZ9gFvYAB3hRag2R1PzOwuw9yFo,1302
|
|
5
|
-
chellow/dloads.py,sha256=
|
|
5
|
+
chellow/dloads.py,sha256=dixp-O0MF2_mlwrnKx3D9DH09Qu05BjTo0rZfigTjR4,5534
|
|
6
6
|
chellow/edi_lib.py,sha256=alu20x9ZX06iPfnNI9dEJzuP6RIf4We3Y_M_bl7RrcY,51789
|
|
7
7
|
chellow/general_import.py,sha256=l3EHq9zG9Vfl5Ee6XTVrC1nusXo4YGGB4VBmZ_JaJR8,65798
|
|
8
8
|
chellow/models.py,sha256=rQLMIpGqFQk0fm7SQsAJbb51j3OM55e-4-MVfh0mBAc,243511
|
|
@@ -92,7 +92,7 @@ chellow/reports/report_asset_comparison.py,sha256=UN298MHuzyUDUiiZr7F_Ua6SrdVOlF
|
|
|
92
92
|
chellow/reports/report_batches.py,sha256=7O5TcB9W1sPKS0LQMsC6sUDzx73X5iyoZE0O3zK91zs,4798
|
|
93
93
|
chellow/reports/report_bills.py,sha256=AHW6tiZAOE0gXDfencPvemE4zqK6eTqfN8_bWQ4RT5o,3323
|
|
94
94
|
chellow/reports/report_csv_llfcs.py,sha256=OHSbP64lQ6dlAMcQYgvdANlA4lQyF0iBlwk7V9c9nuo,1944
|
|
95
|
-
chellow/reports/report_csv_site_hh_data.py,sha256=
|
|
95
|
+
chellow/reports/report_csv_site_hh_data.py,sha256=yWhEoGGyg_ctM8T55raksTPRJ5ycVO6lVfUx5tRBzTQ,4372
|
|
96
96
|
chellow/reports/report_csv_site_snags.py,sha256=gG2sYQrLoIBwCoMUC8rhmAL7Kffh_rvNb9UOX7cYDko,2668
|
|
97
97
|
chellow/reports/report_ecoes_comparison.py,sha256=PGDJKI2f6DCVCH0xcp--BzXWAWFfTDGgcKVQnfqxBKg,21653
|
|
98
98
|
chellow/reports/report_g_monthly_duration.py,sha256=FMMFIWFfGW2Bd9Excpf4LLXXqQ-fbnZZ_KfNa1VaPqA,13034
|
|
@@ -365,6 +365,6 @@ chellow/templates/g/supply_note_edit.html,sha256=b8mB6_ucBwoljp03iy6AgVaZUhGw3-1
|
|
|
365
365
|
chellow/templates/g/supply_notes.html,sha256=6epNmZ3NKdXZz27fvmRUGeffg_oc1kmwuBeyRzQe3Rg,854
|
|
366
366
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
367
367
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
368
|
-
chellow-
|
|
369
|
-
chellow-
|
|
370
|
-
chellow-
|
|
368
|
+
chellow-1724334398.0.0.dist-info/METADATA,sha256=pqYIzP5QRUm6h-OprcFHq3lYO4fl_hYTTKksG19zR1k,12241
|
|
369
|
+
chellow-1724334398.0.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
370
|
+
chellow-1724334398.0.0.dist-info/RECORD,,
|
|
File without changes
|