chellow 1713170458.0.0__py3-none-any.whl → 1713268896.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/bill_parsers/csv.py +7 -3
- chellow/e/views.py +1 -1
- chellow/general_import.py +26 -25
- chellow/templates/base.html +1 -0
- chellow/templates/e/comm.html +3 -3
- chellow/templates/general_imports.html +1 -0
- {chellow-1713170458.0.0.dist-info → chellow-1713268896.0.0.dist-info}/METADATA +1 -1
- {chellow-1713170458.0.0.dist-info → chellow-1713268896.0.0.dist-info}/RECORD +9 -9
- {chellow-1713170458.0.0.dist-info → chellow-1713268896.0.0.dist-info}/WHEEL +1 -1
chellow/e/bill_parsers/csv.py
CHANGED
|
@@ -6,6 +6,8 @@ from dateutil.relativedelta import relativedelta
|
|
|
6
6
|
|
|
7
7
|
from werkzeug.exceptions import BadRequest
|
|
8
8
|
|
|
9
|
+
from zish import ZishLocationException
|
|
10
|
+
|
|
9
11
|
from chellow.utils import (
|
|
10
12
|
HH,
|
|
11
13
|
ct_datetime_parse,
|
|
@@ -44,7 +46,7 @@ class Parser:
|
|
|
44
46
|
raw_bills = []
|
|
45
47
|
next(iter(self.reader)) # skip title row
|
|
46
48
|
blank_set = set(("",))
|
|
47
|
-
for self.line_number, self.vals in enumerate(self.reader, start=
|
|
49
|
+
for self.line_number, self.vals in enumerate(self.reader, start=2):
|
|
48
50
|
try:
|
|
49
51
|
# skip blank lines
|
|
50
52
|
if len(self.vals) == 0 or set(self.vals) == blank_set:
|
|
@@ -72,7 +74,7 @@ class Parser:
|
|
|
72
74
|
else:
|
|
73
75
|
try:
|
|
74
76
|
breakdown = loads(breakdown_str)
|
|
75
|
-
except
|
|
77
|
+
except ZishLocationException as e:
|
|
76
78
|
raise BadRequest(str(e))
|
|
77
79
|
else:
|
|
78
80
|
raise BadRequest("There isn't a 'breakdown' field on the end.")
|
|
@@ -117,7 +119,9 @@ class Parser:
|
|
|
117
119
|
}
|
|
118
120
|
raw_bills.append(raw_bill)
|
|
119
121
|
except BadRequest as e:
|
|
120
|
-
raise BadRequest(
|
|
122
|
+
raise BadRequest(
|
|
123
|
+
f"Problem at line {self.line_number} {self.vals}: {e.description}"
|
|
124
|
+
)
|
|
121
125
|
|
|
122
126
|
return raw_bills
|
|
123
127
|
|
chellow/e/views.py
CHANGED
|
@@ -420,7 +420,7 @@ def channel_snag_edit_post(snag_id):
|
|
|
420
420
|
|
|
421
421
|
@e.route("/comms")
|
|
422
422
|
def comms_get():
|
|
423
|
-
comms = g.sess.execute(select(
|
|
423
|
+
comms = g.sess.execute(select(Comm).order_by(Comm.code)).scalars()
|
|
424
424
|
return render_template("comms.html", comms=comms)
|
|
425
425
|
|
|
426
426
|
|
chellow/general_import.py
CHANGED
|
@@ -1247,20 +1247,26 @@ def general_import_supply(sess, action, vals, args):
|
|
|
1247
1247
|
dc_account = add_arg(args, "DC Account", vals, 10)
|
|
1248
1248
|
msn = add_arg(args, "Meter Serial Number", vals, 11)
|
|
1249
1249
|
dno_code = add_arg(args, "DNO Code", vals, 12)
|
|
1250
|
-
dno = Party.get_dno_by_code(sess, dno_code)
|
|
1250
|
+
dno = Party.get_dno_by_code(sess, dno_code, start_date)
|
|
1251
1251
|
pc_code = add_arg(args, "Profile Class", vals, 13)
|
|
1252
1252
|
pc = Pc.get_by_code(sess, parse_pc_code(pc_code))
|
|
1253
1253
|
mtc_code = add_arg(args, "Meter Timeswitch Class", vals, 14)
|
|
1254
1254
|
cop_code = add_arg(args, "CoP", vals, 15)
|
|
1255
1255
|
cop = Cop.get_by_code(sess, cop_code)
|
|
1256
|
-
|
|
1256
|
+
comm_code = add_arg(args, "Comms Type", vals, 16)
|
|
1257
|
+
comm = Comm.get_by_code(sess, comm_code)
|
|
1258
|
+
ssc_code = add_arg(args, "Standard Settlement Configuration", vals, 17)
|
|
1257
1259
|
ssc = Ssc.get_by_code(sess, ssc_code) if len(ssc_code) > 0 else None
|
|
1258
|
-
|
|
1260
|
+
energisation_status_code = add_arg(args, "Energisation Status", vals, 18)
|
|
1261
|
+
energisation_status = EnergisationStatus.get_by_code(
|
|
1262
|
+
sess, energisation_status_code
|
|
1263
|
+
)
|
|
1264
|
+
properties_str = add_arg(args, "Properties", vals, 19)
|
|
1259
1265
|
try:
|
|
1260
1266
|
properties = loads(properties_str)
|
|
1261
1267
|
except ZishException as e:
|
|
1262
|
-
raise BadRequest("Can't parse the properties field. "
|
|
1263
|
-
imp_mpan_core = add_arg(args, "Import MPAN Core", vals,
|
|
1268
|
+
raise BadRequest(f"Can't parse the properties field. {e}")
|
|
1269
|
+
imp_mpan_core = add_arg(args, "Import MPAN Core", vals, 20)
|
|
1264
1270
|
if len(imp_mpan_core) == 0:
|
|
1265
1271
|
imp_mpan_core = None
|
|
1266
1272
|
else:
|
|
@@ -1272,55 +1278,48 @@ def general_import_supply(sess, action, vals, args):
|
|
|
1272
1278
|
imp_supplier_account = None
|
|
1273
1279
|
imp_sc = None
|
|
1274
1280
|
else:
|
|
1275
|
-
imp_llfc_code = add_arg(args, "Import LLFC", vals,
|
|
1276
|
-
imp_sc_str = add_arg(args, "Import Agreed Supply Capacity", vals,
|
|
1281
|
+
imp_llfc_code = add_arg(args, "Import LLFC", vals, 21)
|
|
1282
|
+
imp_sc_str = add_arg(args, "Import Agreed Supply Capacity", vals, 22)
|
|
1277
1283
|
try:
|
|
1278
1284
|
imp_sc = int(imp_sc_str)
|
|
1279
1285
|
except ValueError as e:
|
|
1280
|
-
raise BadRequest(
|
|
1281
|
-
"The import supply capacity must be an integer." + str(e)
|
|
1282
|
-
)
|
|
1286
|
+
raise BadRequest(f"The import supply capacity must be an integer. {e}")
|
|
1283
1287
|
|
|
1284
1288
|
imp_supplier_contract_name = add_arg(
|
|
1285
|
-
args, "Import Supplier Contract", vals,
|
|
1289
|
+
args, "Import Supplier Contract", vals, 23
|
|
1286
1290
|
)
|
|
1287
|
-
imp_supplier_account = add_arg(args, "Import Supplier Account", vals,
|
|
1291
|
+
imp_supplier_account = add_arg(args, "Import Supplier Account", vals, 24)
|
|
1288
1292
|
imp_supplier_contract = Contract.get_supplier_by_name(
|
|
1289
1293
|
sess, imp_supplier_contract_name
|
|
1290
1294
|
)
|
|
1291
1295
|
|
|
1292
|
-
exp_supplier_contract = None
|
|
1293
|
-
exp_sc = None
|
|
1294
|
-
exp_llfc_code = None
|
|
1295
|
-
exp_mpan_core = None
|
|
1296
|
+
exp_supplier_contract = exp_sc = exp_llfc_code = exp_mpan_core = None
|
|
1296
1297
|
exp_supplier_account = None
|
|
1297
|
-
if len(vals) >
|
|
1298
|
-
exp_mpan_core = add_arg(args, "Export MPAN Core", vals,
|
|
1298
|
+
if len(vals) > 25:
|
|
1299
|
+
exp_mpan_core = add_arg(args, "Export MPAN Core", vals, 25)
|
|
1299
1300
|
if len(exp_mpan_core) == 0:
|
|
1300
1301
|
exp_mpan_core = None
|
|
1301
1302
|
else:
|
|
1302
1303
|
exp_mpan_core = parse_mpan_core(exp_mpan_core)
|
|
1303
1304
|
|
|
1304
1305
|
if exp_mpan_core is not None:
|
|
1305
|
-
exp_llfc_code = add_arg(args, "Export LLFC", vals,
|
|
1306
|
-
exp_sc_str = add_arg(args, "Export Agreed Supply Capacity", vals,
|
|
1306
|
+
exp_llfc_code = add_arg(args, "Export LLFC", vals, 26)
|
|
1307
|
+
exp_sc_str = add_arg(args, "Export Agreed Supply Capacity", vals, 27)
|
|
1307
1308
|
try:
|
|
1308
1309
|
exp_sc = int(exp_sc_str)
|
|
1309
1310
|
except ValueError as e:
|
|
1310
1311
|
raise BadRequest(
|
|
1311
|
-
"The export agreed supply capacity "
|
|
1312
|
-
+ "must be an integer."
|
|
1313
|
-
+ str(e)
|
|
1312
|
+
f"The export agreed supply capacity must be an integer. {e}"
|
|
1314
1313
|
)
|
|
1315
1314
|
|
|
1316
1315
|
exp_supplier_contract_name = add_arg(
|
|
1317
|
-
args, "Export Supplier Contract", vals,
|
|
1316
|
+
args, "Export Supplier Contract", vals, 28
|
|
1318
1317
|
)
|
|
1319
1318
|
exp_supplier_contract = Contract.get_supplier_by_name(
|
|
1320
1319
|
sess, exp_supplier_contract_name
|
|
1321
1320
|
)
|
|
1322
1321
|
exp_supplier_account = add_arg(
|
|
1323
|
-
args, "Export Supplier Account", vals,
|
|
1322
|
+
args, "Export Supplier Account", vals, 29
|
|
1324
1323
|
)
|
|
1325
1324
|
|
|
1326
1325
|
supply = site.insert_e_supply(
|
|
@@ -1340,7 +1339,9 @@ def general_import_supply(sess, action, vals, args):
|
|
|
1340
1339
|
pc,
|
|
1341
1340
|
mtc_code,
|
|
1342
1341
|
cop,
|
|
1342
|
+
comm,
|
|
1343
1343
|
ssc,
|
|
1344
|
+
energisation_status,
|
|
1344
1345
|
properties,
|
|
1345
1346
|
imp_mpan_core,
|
|
1346
1347
|
imp_llfc_code,
|
chellow/templates/base.html
CHANGED
|
@@ -107,6 +107,7 @@
|
|
|
107
107
|
<li><a href="/e/sscs" title="SSCs">SSCs</a></li>
|
|
108
108
|
<li><a href="/e/gsp_groups" title="GSP Groups">GSP Groups</a></li>
|
|
109
109
|
<li><a href="/e/cops" title="CoPs">CoPs</a></li>
|
|
110
|
+
<li><a href="/e/comms" title="Comms">Comms</a></li>
|
|
110
111
|
<li><a href="/bill_types" title="Bill Types">Bill Types</a></li>
|
|
111
112
|
<li><a href="/e/read_types" title="Read Types">Read Types</a></li>
|
|
112
113
|
<li>
|
chellow/templates/e/comm.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
{% endblock %}
|
|
6
6
|
|
|
7
7
|
{% block nav %}
|
|
8
|
-
<a href="/comms">Comms</a> » {{
|
|
8
|
+
<a href="/e/comms">Comms</a> » {{comm.description}}
|
|
9
9
|
{% endblock %}
|
|
10
10
|
|
|
11
11
|
{% block content %}
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
<table>
|
|
14
14
|
<tr>
|
|
15
15
|
<th>Code</th>
|
|
16
|
-
<td>{{
|
|
16
|
+
<td>{{comm.code}}</td>
|
|
17
17
|
</tr>
|
|
18
18
|
<tr>
|
|
19
19
|
<th>Description</th>
|
|
20
|
-
<td>{{
|
|
20
|
+
<td>{{comm.description}}</td>
|
|
21
21
|
</tr>
|
|
22
22
|
</table>
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: chellow
|
|
3
|
-
Version:
|
|
3
|
+
Version: 1713268896.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)
|
|
@@ -4,7 +4,7 @@ chellow/bank_holidays.py,sha256=T_utYMwe_g1dz5X-aOTdIPryg49SvB7QsWM1yphlqG8,4423
|
|
|
4
4
|
chellow/commands.py,sha256=ESBe9ZWj1c3vdZgqMZ9gFvYAB3hRag2R1PzOwuw9yFo,1302
|
|
5
5
|
chellow/dloads.py,sha256=5SmP-0QPK6xCkd_wjIWh_8FAzN5OxNHCzyEQ1Xb-Y-M,5256
|
|
6
6
|
chellow/edi_lib.py,sha256=het3R0DBGtXEo-Sy1zvXQuX9EWQ1X6Y33G4l1hYYuds,51859
|
|
7
|
-
chellow/general_import.py,sha256=
|
|
7
|
+
chellow/general_import.py,sha256=d_bDfUW8VulF6FqT5q7jiQ0a_NmVpUVyzXNgNBLpn0k,65263
|
|
8
8
|
chellow/models.py,sha256=9SDx150OdxFnw4tfpvLn2fB0NsqlrE57VqdRPYz9OnE,237335
|
|
9
9
|
chellow/national_grid.py,sha256=uxcv0qisHPyzw9AVIYPzsRqwt2XPAcZL-SBR12qcrS0,4364
|
|
10
10
|
chellow/proxy.py,sha256=cVXIktPlX3tQ1BYcwxq0nJXKE6r3DtFTtfFHPq55HaM,1351
|
|
@@ -38,12 +38,12 @@ chellow/e/system_price.py,sha256=3cPWohHmmBI9v7fENLBzXQkpAeC3r0s5xV29Nmr6k_E,583
|
|
|
38
38
|
chellow/e/tlms.py,sha256=kHAy2A2d1Mma7x4GdNDyrzscJd5DpJtDBYiZEg241Dw,8538
|
|
39
39
|
chellow/e/tnuos.py,sha256=KoMPJDIXfE4zwhSDuywGF1ooxjTYLVjtF7BkSFm6X24,4158
|
|
40
40
|
chellow/e/triad.py,sha256=S6LEMHvUKhAZe0-yfLIRciYDZ8IKMn1jh1TmmsbQD3s,13588
|
|
41
|
-
chellow/e/views.py,sha256=
|
|
41
|
+
chellow/e/views.py,sha256=ccA5ebQA8Oefwi9L71rbStvHenDMB4rhAu0iRMandLc,213977
|
|
42
42
|
chellow/e/bill_parsers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
43
43
|
chellow/e/bill_parsers/activity_mop_stark_xlsx.py,sha256=UgWXDPzQkQghyj_lfgBqoSJpHB-t-qOdSaB8qY6GLog,4071
|
|
44
44
|
chellow/e/bill_parsers/annual_mop_stark_xlsx.py,sha256=-HMoIfa_utXYKA44RuC0Xqv3vd2HLeQU_4P0iBUd3WA,4219
|
|
45
45
|
chellow/e/bill_parsers/bgb_edi.py,sha256=GuwHeYbAGk7BVg5n19FcTANFDyKI-y0z3f9niQaPSSw,4828
|
|
46
|
-
chellow/e/bill_parsers/csv.py,sha256=
|
|
46
|
+
chellow/e/bill_parsers/csv.py,sha256=U5zcIaZ6B5QTTpFDAcBnk4G2r8B3j5kJhDPL4AJNkEk,5640
|
|
47
47
|
chellow/e/bill_parsers/engie_edi.py,sha256=CTobTskDjzdcqqf_qk2ukDSaTLrVpGZMM0sYlwehog4,14985
|
|
48
48
|
chellow/e/bill_parsers/engie_xls.py,sha256=jrut2heH_ZWmSjcn7celOydZS9Y49GfpYjDk_EKwamI,14453
|
|
49
49
|
chellow/e/bill_parsers/engie_xlsx.py,sha256=L6lmTslsJxtFAWkRn6f4xFHBCwgoH5sW8x4_ckE4T7g,15793
|
|
@@ -106,7 +106,7 @@ chellow/static/images/favicon_test.svg,sha256=HnLS_BjNt8M0Ikko5Z-f_E2aed7y6RRU6j
|
|
|
106
106
|
chellow/static/images/logo.png,sha256=XMW2XwukTicKVJ46E2SnbHJYh77uFLVYlwR4xN43YKg,1569
|
|
107
107
|
chellow/static/js/htmx.min.js,sha256=_TRunIY51GJIk_xFXyQHoJtBgwFzbdGOu7B3ZGN_tHg,42819
|
|
108
108
|
chellow/templates/403.html,sha256=49f75OKp0eS8wi2D1YBhdv7bKTNtfs6BTXZPXlxCbDs,344
|
|
109
|
-
chellow/templates/base.html,sha256=
|
|
109
|
+
chellow/templates/base.html,sha256=tilhJHj1oTB7H802TSobnuIDip9o2Ws4zJSleM3bgUM,6581
|
|
110
110
|
chellow/templates/bill_type.html,sha256=dNNEaQ9ZVghLCAvxQ6IDalw0K0-BIjEQap6u1zu6TW8,402
|
|
111
111
|
chellow/templates/bill_types.html,sha256=YKy6cnzzch756dlTnl01ZU0K5NVuTZtBJQV32ZphHvc,471
|
|
112
112
|
chellow/templates/chain.html,sha256=iOnSoDQOO_-1tfcxUHQKDAUnV4QbCYu5PPNmS4RkOg4,775
|
|
@@ -114,7 +114,7 @@ chellow/templates/csv_sites_monthly_duration.html,sha256=59gErG6KwA57z-qh2EJsVGv
|
|
|
114
114
|
chellow/templates/downloads.html,sha256=R9QPcFz-PLJOX7rDlmquIk-Hp9Iq-thzWCTfOexSpXg,937
|
|
115
115
|
chellow/templates/edi_viewer.html,sha256=szUthgHOdph6Of-7f_1LeC_zYlNJaMeS5ctn6xTAeiM,1437
|
|
116
116
|
chellow/templates/general_import.html,sha256=SMemHGu466Be3_cAWSS6Hn-Kv-1psbEMDD6NQG6bfbI,1013
|
|
117
|
-
chellow/templates/general_imports.html,sha256=
|
|
117
|
+
chellow/templates/general_imports.html,sha256=9rFbve28ADnfJ4CL45vJbOPG-mAYBETWVa_ctgcXvHg,13050
|
|
118
118
|
chellow/templates/home.html,sha256=_ANKmcnlk_PDyZl6SCmejU8d90f3t8EH_rDDPDyYUwE,5657
|
|
119
119
|
chellow/templates/input_date.html,sha256=rpgB5n0LfN8Y5djN_ZiuSxqdskxzCoKrEqI7hyJkVQo,1248
|
|
120
120
|
chellow/templates/local_report.html,sha256=pV7_0QwyQ-D3OS9LXrly5pq3qprZnwTCoq6vCnMTkS4,1332
|
|
@@ -159,7 +159,7 @@ chellow/templates/e/channel_edit.html,sha256=OUkdiS2NBQ_w4gmxRxXAcRToM5BT8DWWJrt
|
|
|
159
159
|
chellow/templates/e/channel_snag.html,sha256=wBJ5KBfeJdAeRmaB0qu0AD9Z4nM5fn6tJ_8bNqTWtoo,1477
|
|
160
160
|
chellow/templates/e/channel_snag_edit.html,sha256=sUFI4Ml3F1B35x8_t_Pz3hWuQN9Xtxr3kt4u8hdxNwY,1911
|
|
161
161
|
chellow/templates/e/channel_snags.html,sha256=1dzC5FoCJ8bg6PBsQrVqGLn-DbPE2EHQklfm_pg3w0c,2899
|
|
162
|
-
chellow/templates/e/comm.html,sha256=
|
|
162
|
+
chellow/templates/e/comm.html,sha256=DSlAaDg1r4KYq9VUgDtt2lgW6apZjZvwhMujIJINmps,383
|
|
163
163
|
chellow/templates/e/comms.html,sha256=bUXZePnMfpKk1E71qLGOSkx8r3GxdPPD_-MosIXXq4s,434
|
|
164
164
|
chellow/templates/e/cop.html,sha256=ULv7ALFJHMUgPX96hQNm2irc3edtKYHS6fYAxvmzj8M,376
|
|
165
165
|
chellow/templates/e/cops.html,sha256=2uFpVZOZtEe8fBE9NU-hElVvT_gTLk9peHNfPKW0PAY,425
|
|
@@ -363,6 +363,6 @@ chellow/templates/g/supply_note_edit.html,sha256=6UQf_qbhFDys3cVsTp-c7ABWZpggW9R
|
|
|
363
363
|
chellow/templates/g/supply_notes.html,sha256=WR3YwGh_qqTklSJ7JqWX6BKBc9rk_jMff4RiWZiF2CM,936
|
|
364
364
|
chellow/templates/g/unit.html,sha256=KouNVU0-i84afANkLQ_heJ0uDfJ9H5A05PuLqb8iCN8,438
|
|
365
365
|
chellow/templates/g/units.html,sha256=p5Nd-lAIboKPEOO6N451hx1bcKxMg4BDODnZ-43MmJc,441
|
|
366
|
-
chellow-
|
|
367
|
-
chellow-
|
|
368
|
-
chellow-
|
|
366
|
+
chellow-1713268896.0.0.dist-info/METADATA,sha256=WJKCUej3oxzq27gZWOLH0JBzVZOal2NmaTyMmJSLcnQ,12205
|
|
367
|
+
chellow-1713268896.0.0.dist-info/WHEEL,sha256=K0BPUNF1N3kQ9olb8aVEtkObePEjdr2JOLT1N83EVws,87
|
|
368
|
+
chellow-1713268896.0.0.dist-info/RECORD,,
|