DLMS-SPODES 0.87.13__py3-none-any.whl → 0.87.16__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.
- DLMS_SPODES/Values/EN/__init__.py +1 -1
- DLMS_SPODES/Values/EN/actors.py +8 -8
- DLMS_SPODES/Values/EN/relation_to_obis_names.py +387 -387
- DLMS_SPODES/Values/RU/__init__.py +1 -1
- DLMS_SPODES/Values/RU/actors.py +8 -8
- DLMS_SPODES/Values/RU/relation_to_obis_names.py +396 -396
- DLMS_SPODES/__init__.py +6 -6
- DLMS_SPODES/configEN.ini +126 -126
- DLMS_SPODES/config_parser.py +53 -53
- DLMS_SPODES/cosem_interface_classes/__class_init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/__init__.py +1 -1
- DLMS_SPODES/cosem_interface_classes/a_parameter.py +20 -20
- DLMS_SPODES/cosem_interface_classes/activity_calendar.py +254 -254
- DLMS_SPODES/cosem_interface_classes/arbitrator.py +105 -105
- DLMS_SPODES/cosem_interface_classes/association_ln/abstract.py +34 -34
- DLMS_SPODES/cosem_interface_classes/association_ln/authentication_mechanism_name.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/mechanism_id.py +25 -25
- DLMS_SPODES/cosem_interface_classes/association_ln/method.py +5 -5
- DLMS_SPODES/cosem_interface_classes/association_ln/ver0.py +485 -485
- DLMS_SPODES/cosem_interface_classes/association_ln/ver1.py +133 -133
- DLMS_SPODES/cosem_interface_classes/association_ln/ver2.py +36 -36
- DLMS_SPODES/cosem_interface_classes/association_ln/ver3.py +4 -4
- DLMS_SPODES/cosem_interface_classes/association_sn/ver0.py +12 -12
- DLMS_SPODES/cosem_interface_classes/attr_indexes.py +12 -12
- DLMS_SPODES/cosem_interface_classes/clock.py +131 -131
- DLMS_SPODES/cosem_interface_classes/collection.py +2122 -2122
- DLMS_SPODES/cosem_interface_classes/cosem_interface_class.py +583 -583
- DLMS_SPODES/cosem_interface_classes/data.py +21 -21
- DLMS_SPODES/cosem_interface_classes/demand_register/ver0.py +59 -59
- DLMS_SPODES/cosem_interface_classes/disconnect_control.py +74 -74
- DLMS_SPODES/cosem_interface_classes/extended_register.py +27 -27
- DLMS_SPODES/cosem_interface_classes/gprs_modem_setup.py +43 -43
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver0.py +103 -103
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver1.py +40 -40
- DLMS_SPODES/cosem_interface_classes/gsm_diagnostic/ver2.py +9 -9
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver0.py +11 -11
- DLMS_SPODES/cosem_interface_classes/iec_hdlc_setup/ver1.py +53 -53
- DLMS_SPODES/cosem_interface_classes/iec_local_port_setup.py +11 -11
- DLMS_SPODES/cosem_interface_classes/image_transfer/image_transfer_status.py +15 -15
- DLMS_SPODES/cosem_interface_classes/image_transfer/ver0.py +126 -126
- DLMS_SPODES/cosem_interface_classes/implementations/__init__.py +3 -3
- DLMS_SPODES/cosem_interface_classes/implementations/arbitrator.py +19 -19
- DLMS_SPODES/cosem_interface_classes/implementations/data.py +487 -487
- DLMS_SPODES/cosem_interface_classes/implementations/profile_generic.py +83 -83
- DLMS_SPODES/cosem_interface_classes/ipv4_setup.py +72 -72
- DLMS_SPODES/cosem_interface_classes/limiter.py +111 -111
- DLMS_SPODES/cosem_interface_classes/ln_pattern.py +333 -333
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver0.py +65 -65
- DLMS_SPODES/cosem_interface_classes/modem_configuration/ver1.py +39 -39
- DLMS_SPODES/cosem_interface_classes/ntp_setup/ver0.py +67 -67
- DLMS_SPODES/cosem_interface_classes/obis.py +23 -23
- DLMS_SPODES/cosem_interface_classes/overview.py +197 -197
- DLMS_SPODES/cosem_interface_classes/parameter.py +547 -547
- DLMS_SPODES/cosem_interface_classes/parameters.py +172 -172
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver0.py +122 -122
- DLMS_SPODES/cosem_interface_classes/profile_generic/ver1.py +277 -277
- DLMS_SPODES/cosem_interface_classes/push_setup/ver0.py +12 -12
- DLMS_SPODES/cosem_interface_classes/push_setup/ver1.py +10 -10
- DLMS_SPODES/cosem_interface_classes/push_setup/ver2.py +166 -166
- DLMS_SPODES/cosem_interface_classes/register.py +45 -45
- DLMS_SPODES/cosem_interface_classes/register_activation/ver0.py +80 -80
- DLMS_SPODES/cosem_interface_classes/register_monitor.py +46 -46
- DLMS_SPODES/cosem_interface_classes/reports.py +70 -70
- DLMS_SPODES/cosem_interface_classes/schedule.py +176 -176
- DLMS_SPODES/cosem_interface_classes/script_table.py +87 -87
- DLMS_SPODES/cosem_interface_classes/security_setup/ver0.py +68 -68
- DLMS_SPODES/cosem_interface_classes/security_setup/ver1.py +158 -158
- DLMS_SPODES/cosem_interface_classes/single_action_schedule.py +50 -50
- DLMS_SPODES/cosem_interface_classes/special_days_table.py +84 -84
- DLMS_SPODES/cosem_interface_classes/tcp_udp_setup.py +42 -42
- DLMS_SPODES/cosem_pdu.py +93 -93
- DLMS_SPODES/enums.py +625 -625
- DLMS_SPODES/exceptions.py +106 -106
- DLMS_SPODES/firmwares.py +99 -99
- DLMS_SPODES/hdlc/frame.py +875 -875
- DLMS_SPODES/hdlc/sub_layer.py +54 -54
- DLMS_SPODES/literals.py +17 -17
- DLMS_SPODES/obis/__init__.py +1 -1
- DLMS_SPODES/obis/media_id.py +931 -931
- DLMS_SPODES/pardata.py +22 -22
- DLMS_SPODES/pdu_enums.py +98 -98
- DLMS_SPODES/relation_to_OBIS.py +465 -463
- DLMS_SPODES/settings.py +551 -551
- DLMS_SPODES/types/choices.py +142 -142
- DLMS_SPODES/types/common_data_types.py +2401 -2401
- DLMS_SPODES/types/cosem_service_types.py +109 -109
- DLMS_SPODES/types/implementations/arrays.py +25 -25
- DLMS_SPODES/types/implementations/bitstrings.py +97 -97
- DLMS_SPODES/types/implementations/double_long_usingneds.py +35 -35
- DLMS_SPODES/types/implementations/enums.py +57 -57
- DLMS_SPODES/types/implementations/integers.py +11 -11
- DLMS_SPODES/types/implementations/long_unsigneds.py +127 -127
- DLMS_SPODES/types/implementations/octet_string.py +11 -11
- DLMS_SPODES/types/implementations/structs.py +64 -64
- DLMS_SPODES/types/useful_types.py +677 -677
- {dlms_spodes-0.87.13.dist-info → dlms_spodes-0.87.16.dist-info}/METADATA +30 -30
- dlms_spodes-0.87.16.dist-info/RECORD +117 -0
- {dlms_spodes-0.87.13.dist-info → dlms_spodes-0.87.16.dist-info}/WHEEL +1 -1
- dlms_spodes-0.87.13.dist-info/RECORD +0 -117
- {dlms_spodes-0.87.13.dist-info → dlms_spodes-0.87.16.dist-info}/top_level.txt +0 -0
DLMS_SPODES/__init__.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
from . import settings
|
|
2
|
-
from .cosem_interface_classes import collection
|
|
3
|
-
from importlib.metadata import version
|
|
4
|
-
from .pardata import ParData
|
|
5
|
-
|
|
6
|
-
__version__ = version("DLMS_SPODES")
|
|
1
|
+
from . import settings
|
|
2
|
+
from .cosem_interface_classes import collection
|
|
3
|
+
from importlib.metadata import version
|
|
4
|
+
from .pardata import ParData
|
|
5
|
+
|
|
6
|
+
__version__ = version("DLMS_SPODES")
|
DLMS_SPODES/configEN.ini
CHANGED
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
[values.common]
|
|
2
|
-
reserved = reserved
|
|
3
|
-
|
|
4
|
-
[values.prefix]
|
|
5
|
-
kilo = k
|
|
6
|
-
|
|
7
|
-
[values.enum]
|
|
8
|
-
# cdt.units
|
|
9
|
-
time_year = a
|
|
10
|
-
time_month = mo
|
|
11
|
-
time_week = wk
|
|
12
|
-
time_day = d
|
|
13
|
-
time_hour = h
|
|
14
|
-
time_minute = min
|
|
15
|
-
time_second = s
|
|
16
|
-
phase_angle_degree = °
|
|
17
|
-
temperature = °c
|
|
18
|
-
local_currency = currency
|
|
19
|
-
length_metre = m
|
|
20
|
-
speed_metre_per_second = m/s
|
|
21
|
-
volume_value_cubic_metre = m³
|
|
22
|
-
corrected_volume_cubic_metre = m³*
|
|
23
|
-
volume_flux_cubic_metre_per_hour = m³/h
|
|
24
|
-
corrected_volume_flux_cubic_metre_per_hour = m³/h*
|
|
25
|
-
volume_flux_cubic_metre_per_day = m³/d
|
|
26
|
-
corrected_volume_flux_cubic_metre_per_day = m³/d
|
|
27
|
-
volume_litre = l
|
|
28
|
-
mass_kilogram = kg
|
|
29
|
-
force_newton = n
|
|
30
|
-
energy_newton_meter = nm
|
|
31
|
-
pressure_pascal = pa
|
|
32
|
-
pressure_bar = bar
|
|
33
|
-
energy_joule = j
|
|
34
|
-
thermal_power_rate_of_change_joule_per_hour = j/h
|
|
35
|
-
active_power_watt = w
|
|
36
|
-
apparent_power_volt_ampere = va
|
|
37
|
-
reactive_power_var = var
|
|
38
|
-
active_energy_value_watt_hour = wh
|
|
39
|
-
apparent_energy_value_volt_ampere_hour = vah
|
|
40
|
-
reactive_energy_value_var_hour = varh
|
|
41
|
-
current_ampere = a
|
|
42
|
-
electrical_charge_coulomb = c
|
|
43
|
-
voltage_volt = v
|
|
44
|
-
electric_field_strength_volt_per_metre = v/m
|
|
45
|
-
capacitance_farad = f
|
|
46
|
-
resistance_ohm = ω
|
|
47
|
-
resistivity = ωm²/m
|
|
48
|
-
magnetic_flux_weber = wb
|
|
49
|
-
magnetic_flux_density_tesla = t
|
|
50
|
-
magnetic_field_strength_ampere_per_metre = a/m
|
|
51
|
-
inductance_henry = h
|
|
52
|
-
frequency_hertz = hz
|
|
53
|
-
rw_active_energy_value = 1/(wh)
|
|
54
|
-
rb_reactive_energy_value = 1/(varh)
|
|
55
|
-
rs_apparent_energy_value = 1/(vah)
|
|
56
|
-
volt_squared_hour_volt_squared_hour_meter = v²h
|
|
57
|
-
ampere_squared_hour = a²h
|
|
58
|
-
mass_flux_kilogram_per_second = kg/s
|
|
59
|
-
conductance_siemens = s, mho
|
|
60
|
-
temperature_kelvin = k
|
|
61
|
-
ru2h_volt_squared_hour_meter = 1/(v²h)
|
|
62
|
-
ri2h_ampere_squared_hour_meter = 1/(a²h)
|
|
63
|
-
rv_meter = 1/m³
|
|
64
|
-
percentage = %%
|
|
65
|
-
ampere_hours = ah
|
|
66
|
-
energy_per_volume = wh/m³
|
|
67
|
-
calorific_value_wobbe = j/m³
|
|
68
|
-
molar_fraction_of_gas_composition_mole_percent = mol %%
|
|
69
|
-
mass_density_quantity_of_material = g/m³
|
|
70
|
-
dynamic_viscosity_pascal_second = pa s
|
|
71
|
-
specific_energy_joule_kilogram = j/kg
|
|
72
|
-
pressure_gram_per_square_centimeter = g/cm²
|
|
73
|
-
pressure_atmosphere = atm
|
|
74
|
-
signal_strength_milliwatt = dbm
|
|
75
|
-
signal_strength_microvolt = dbµv
|
|
76
|
-
logarithmic_unit = db
|
|
77
|
-
length_inch = in
|
|
78
|
-
length_foot = ft
|
|
79
|
-
mass_pound = lb
|
|
80
|
-
temperature_fahrenheit = °f
|
|
81
|
-
temperature_rankine = °r
|
|
82
|
-
area_square_inch = sq. in
|
|
83
|
-
area_square_foot = sq ft
|
|
84
|
-
area_acre = ac
|
|
85
|
-
volume_cubic_inch = cu in
|
|
86
|
-
volume_cubic_foot = cu ft
|
|
87
|
-
volume_acre_foot = ac ft
|
|
88
|
-
volume_gallon_imperial = gal(imp)
|
|
89
|
-
volume_gallon_us = gal(us)
|
|
90
|
-
force_pound_force = lbf
|
|
91
|
-
pressure_pound_force_per_square_inch = psi
|
|
92
|
-
density_pound_per_cubic_foot = lb/cu ft
|
|
93
|
-
dynamic_viscosity = lb/(ft .s)
|
|
94
|
-
kinematic_viscosity_square_foot_per_second = sq ft/s
|
|
95
|
-
energy_british_thermal_unit = btu
|
|
96
|
-
energy_therm_eu = thm(ec)
|
|
97
|
-
energy_therm_us = thm(us)
|
|
98
|
-
calorific_value_of_mass_lenthalpy = btu/lb
|
|
99
|
-
calorific_value_of_volume_wobbe = btu/cu ft
|
|
100
|
-
volume_meter_cubic_feet_rv = cu ft rv
|
|
101
|
-
speed_foot_per_second = ft/s
|
|
102
|
-
volume_flux_cubic_foot_per_second = cu ft/s
|
|
103
|
-
volume_flux_cubic_foot_per_min = cu ft/min
|
|
104
|
-
volume_flux_cubic_foot_per_hour = cu ft/h
|
|
105
|
-
volume_flux_cubic_foot_per_day = cu ft/d
|
|
106
|
-
volume_flux_acre_foot_per_second = ac ft/s
|
|
107
|
-
volume_flux_acre_foot_per_min = ac ft/min
|
|
108
|
-
volume_flux_acre_foot_per_hour = ac ft/h
|
|
109
|
-
volume_flux_acre_foot_per_day = ac ft/d
|
|
110
|
-
volume_imperial_gallon_meter_rv = gal(imp) rv
|
|
111
|
-
volume_flux_imperial_gallon_per_second = gal(imp)/s
|
|
112
|
-
volume_flux_imperial_gallon_per_min = gal(imp)/min
|
|
113
|
-
volume_flux_imperial_gallon_per_hour = gal(imp)/h
|
|
114
|
-
volume_flux_imperial_gallon_per_day = gal(imp)/d
|
|
115
|
-
volume_us_gallon_rv = gal(us) rv
|
|
116
|
-
volume_flux_us_gallon_per_second = gal(us)/s
|
|
117
|
-
volume_flux_us_gallon_per_min = gal(us)/min
|
|
118
|
-
volume_flux_us_gallon_per_hour = gal(us)/h
|
|
119
|
-
volume_flux_us_gallon_per_day = gal(us)/d
|
|
120
|
-
energy_flow_british_thermal_unit_per_second = btu/s
|
|
121
|
-
energy_flow_british_thermal_unit_per_minute = btu/min
|
|
122
|
-
energy_flow_british_thermal_unit_per_hour = btu/h
|
|
123
|
-
energy_flow_british_thermal_unit_per_day = btu/d
|
|
124
|
-
extended_table_of_units = extended
|
|
125
|
-
other_unit = other
|
|
126
|
-
no_unit_unitless_count = count
|
|
1
|
+
[values.common]
|
|
2
|
+
reserved = reserved
|
|
3
|
+
|
|
4
|
+
[values.prefix]
|
|
5
|
+
kilo = k
|
|
6
|
+
|
|
7
|
+
[values.enum]
|
|
8
|
+
# cdt.units
|
|
9
|
+
time_year = a
|
|
10
|
+
time_month = mo
|
|
11
|
+
time_week = wk
|
|
12
|
+
time_day = d
|
|
13
|
+
time_hour = h
|
|
14
|
+
time_minute = min
|
|
15
|
+
time_second = s
|
|
16
|
+
phase_angle_degree = °
|
|
17
|
+
temperature = °c
|
|
18
|
+
local_currency = currency
|
|
19
|
+
length_metre = m
|
|
20
|
+
speed_metre_per_second = m/s
|
|
21
|
+
volume_value_cubic_metre = m³
|
|
22
|
+
corrected_volume_cubic_metre = m³*
|
|
23
|
+
volume_flux_cubic_metre_per_hour = m³/h
|
|
24
|
+
corrected_volume_flux_cubic_metre_per_hour = m³/h*
|
|
25
|
+
volume_flux_cubic_metre_per_day = m³/d
|
|
26
|
+
corrected_volume_flux_cubic_metre_per_day = m³/d
|
|
27
|
+
volume_litre = l
|
|
28
|
+
mass_kilogram = kg
|
|
29
|
+
force_newton = n
|
|
30
|
+
energy_newton_meter = nm
|
|
31
|
+
pressure_pascal = pa
|
|
32
|
+
pressure_bar = bar
|
|
33
|
+
energy_joule = j
|
|
34
|
+
thermal_power_rate_of_change_joule_per_hour = j/h
|
|
35
|
+
active_power_watt = w
|
|
36
|
+
apparent_power_volt_ampere = va
|
|
37
|
+
reactive_power_var = var
|
|
38
|
+
active_energy_value_watt_hour = wh
|
|
39
|
+
apparent_energy_value_volt_ampere_hour = vah
|
|
40
|
+
reactive_energy_value_var_hour = varh
|
|
41
|
+
current_ampere = a
|
|
42
|
+
electrical_charge_coulomb = c
|
|
43
|
+
voltage_volt = v
|
|
44
|
+
electric_field_strength_volt_per_metre = v/m
|
|
45
|
+
capacitance_farad = f
|
|
46
|
+
resistance_ohm = ω
|
|
47
|
+
resistivity = ωm²/m
|
|
48
|
+
magnetic_flux_weber = wb
|
|
49
|
+
magnetic_flux_density_tesla = t
|
|
50
|
+
magnetic_field_strength_ampere_per_metre = a/m
|
|
51
|
+
inductance_henry = h
|
|
52
|
+
frequency_hertz = hz
|
|
53
|
+
rw_active_energy_value = 1/(wh)
|
|
54
|
+
rb_reactive_energy_value = 1/(varh)
|
|
55
|
+
rs_apparent_energy_value = 1/(vah)
|
|
56
|
+
volt_squared_hour_volt_squared_hour_meter = v²h
|
|
57
|
+
ampere_squared_hour = a²h
|
|
58
|
+
mass_flux_kilogram_per_second = kg/s
|
|
59
|
+
conductance_siemens = s, mho
|
|
60
|
+
temperature_kelvin = k
|
|
61
|
+
ru2h_volt_squared_hour_meter = 1/(v²h)
|
|
62
|
+
ri2h_ampere_squared_hour_meter = 1/(a²h)
|
|
63
|
+
rv_meter = 1/m³
|
|
64
|
+
percentage = %%
|
|
65
|
+
ampere_hours = ah
|
|
66
|
+
energy_per_volume = wh/m³
|
|
67
|
+
calorific_value_wobbe = j/m³
|
|
68
|
+
molar_fraction_of_gas_composition_mole_percent = mol %%
|
|
69
|
+
mass_density_quantity_of_material = g/m³
|
|
70
|
+
dynamic_viscosity_pascal_second = pa s
|
|
71
|
+
specific_energy_joule_kilogram = j/kg
|
|
72
|
+
pressure_gram_per_square_centimeter = g/cm²
|
|
73
|
+
pressure_atmosphere = atm
|
|
74
|
+
signal_strength_milliwatt = dbm
|
|
75
|
+
signal_strength_microvolt = dbµv
|
|
76
|
+
logarithmic_unit = db
|
|
77
|
+
length_inch = in
|
|
78
|
+
length_foot = ft
|
|
79
|
+
mass_pound = lb
|
|
80
|
+
temperature_fahrenheit = °f
|
|
81
|
+
temperature_rankine = °r
|
|
82
|
+
area_square_inch = sq. in
|
|
83
|
+
area_square_foot = sq ft
|
|
84
|
+
area_acre = ac
|
|
85
|
+
volume_cubic_inch = cu in
|
|
86
|
+
volume_cubic_foot = cu ft
|
|
87
|
+
volume_acre_foot = ac ft
|
|
88
|
+
volume_gallon_imperial = gal(imp)
|
|
89
|
+
volume_gallon_us = gal(us)
|
|
90
|
+
force_pound_force = lbf
|
|
91
|
+
pressure_pound_force_per_square_inch = psi
|
|
92
|
+
density_pound_per_cubic_foot = lb/cu ft
|
|
93
|
+
dynamic_viscosity = lb/(ft .s)
|
|
94
|
+
kinematic_viscosity_square_foot_per_second = sq ft/s
|
|
95
|
+
energy_british_thermal_unit = btu
|
|
96
|
+
energy_therm_eu = thm(ec)
|
|
97
|
+
energy_therm_us = thm(us)
|
|
98
|
+
calorific_value_of_mass_lenthalpy = btu/lb
|
|
99
|
+
calorific_value_of_volume_wobbe = btu/cu ft
|
|
100
|
+
volume_meter_cubic_feet_rv = cu ft rv
|
|
101
|
+
speed_foot_per_second = ft/s
|
|
102
|
+
volume_flux_cubic_foot_per_second = cu ft/s
|
|
103
|
+
volume_flux_cubic_foot_per_min = cu ft/min
|
|
104
|
+
volume_flux_cubic_foot_per_hour = cu ft/h
|
|
105
|
+
volume_flux_cubic_foot_per_day = cu ft/d
|
|
106
|
+
volume_flux_acre_foot_per_second = ac ft/s
|
|
107
|
+
volume_flux_acre_foot_per_min = ac ft/min
|
|
108
|
+
volume_flux_acre_foot_per_hour = ac ft/h
|
|
109
|
+
volume_flux_acre_foot_per_day = ac ft/d
|
|
110
|
+
volume_imperial_gallon_meter_rv = gal(imp) rv
|
|
111
|
+
volume_flux_imperial_gallon_per_second = gal(imp)/s
|
|
112
|
+
volume_flux_imperial_gallon_per_min = gal(imp)/min
|
|
113
|
+
volume_flux_imperial_gallon_per_hour = gal(imp)/h
|
|
114
|
+
volume_flux_imperial_gallon_per_day = gal(imp)/d
|
|
115
|
+
volume_us_gallon_rv = gal(us) rv
|
|
116
|
+
volume_flux_us_gallon_per_second = gal(us)/s
|
|
117
|
+
volume_flux_us_gallon_per_min = gal(us)/min
|
|
118
|
+
volume_flux_us_gallon_per_hour = gal(us)/h
|
|
119
|
+
volume_flux_us_gallon_per_day = gal(us)/d
|
|
120
|
+
energy_flow_british_thermal_unit_per_second = btu/s
|
|
121
|
+
energy_flow_british_thermal_unit_per_minute = btu/min
|
|
122
|
+
energy_flow_british_thermal_unit_per_hour = btu/h
|
|
123
|
+
energy_flow_british_thermal_unit_per_day = btu/d
|
|
124
|
+
extended_table_of_units = extended
|
|
125
|
+
other_unit = other
|
|
126
|
+
no_unit_unitless_count = count
|
DLMS_SPODES/config_parser.py
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import tomllib
|
|
3
|
-
from typing_extensions import deprecated
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
print("Path: ", os.getcwd())
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
@deprecated("use settings.settings")
|
|
10
|
-
def get_values(*args: str) -> dict | None:
|
|
11
|
-
args = list(args)
|
|
12
|
-
par = config
|
|
13
|
-
while args:
|
|
14
|
-
key = args.pop(0)
|
|
15
|
-
try:
|
|
16
|
-
par = par[key]
|
|
17
|
-
continue
|
|
18
|
-
except KeyError as e:
|
|
19
|
-
print(f"error: {e.args[0]}")
|
|
20
|
-
return None
|
|
21
|
-
return par
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if not os.path.isfile(path := ".//config.toml"):
|
|
25
|
-
path = F"{os.path.dirname(__file__)}{path}"
|
|
26
|
-
elif not os.path.isfile(path):
|
|
27
|
-
print("NOT FIND CONFIGURATION: <config.toml>")
|
|
28
|
-
with open(path, "rb") as f:
|
|
29
|
-
config = tomllib.load(f)
|
|
30
|
-
print(F"Find configuration <config.toml> with path: {f}")
|
|
31
|
-
|
|
32
|
-
_messages = get_values("DLMS", "messages")
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
def get_message(value: str) -> str:
|
|
36
|
-
"""translate %... from config.toml"""
|
|
37
|
-
value: bytearray = bytearray(value, "utf-8")
|
|
38
|
-
ret: bytearray = bytearray()
|
|
39
|
-
while value:
|
|
40
|
-
if value.startswith(b"$$"):
|
|
41
|
-
value.pop(0)
|
|
42
|
-
ret.append(value.pop(0))
|
|
43
|
-
elif value.startswith(b"$"):
|
|
44
|
-
key, sep, value = value[1:].partition(b"$")
|
|
45
|
-
if key:
|
|
46
|
-
if _messages and (translate := _messages.get(key.decode("utf-8"))):
|
|
47
|
-
val = bytes(translate, "utf-8")
|
|
48
|
-
else:
|
|
49
|
-
val = key
|
|
50
|
-
ret.extend(val)
|
|
51
|
-
else:
|
|
52
|
-
ret.append(value.pop(0))
|
|
53
|
-
return ret.decode("utf-8", errors="strict")
|
|
1
|
+
import os
|
|
2
|
+
import tomllib
|
|
3
|
+
from typing_extensions import deprecated
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
print("Path: ", os.getcwd())
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@deprecated("use settings.settings")
|
|
10
|
+
def get_values(*args: str) -> dict | None:
|
|
11
|
+
args = list(args)
|
|
12
|
+
par = config
|
|
13
|
+
while args:
|
|
14
|
+
key = args.pop(0)
|
|
15
|
+
try:
|
|
16
|
+
par = par[key]
|
|
17
|
+
continue
|
|
18
|
+
except KeyError as e:
|
|
19
|
+
print(f"error: {e.args[0]}")
|
|
20
|
+
return None
|
|
21
|
+
return par
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
if not os.path.isfile(path := ".//config.toml"):
|
|
25
|
+
path = F"{os.path.dirname(__file__)}{path}"
|
|
26
|
+
elif not os.path.isfile(path):
|
|
27
|
+
print("NOT FIND CONFIGURATION: <config.toml>")
|
|
28
|
+
with open(path, "rb") as f:
|
|
29
|
+
config = tomllib.load(f)
|
|
30
|
+
print(F"Find configuration <config.toml> with path: {f}")
|
|
31
|
+
|
|
32
|
+
_messages = get_values("DLMS", "messages")
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def get_message(value: str) -> str:
|
|
36
|
+
"""translate %... from config.toml"""
|
|
37
|
+
value: bytearray = bytearray(value, "utf-8")
|
|
38
|
+
ret: bytearray = bytearray()
|
|
39
|
+
while value:
|
|
40
|
+
if value.startswith(b"$$"):
|
|
41
|
+
value.pop(0)
|
|
42
|
+
ret.append(value.pop(0))
|
|
43
|
+
elif value.startswith(b"$"):
|
|
44
|
+
key, sep, value = value[1:].partition(b"$")
|
|
45
|
+
if key:
|
|
46
|
+
if _messages and (translate := _messages.get(key.decode("utf-8"))):
|
|
47
|
+
val = bytes(translate, "utf-8")
|
|
48
|
+
else:
|
|
49
|
+
val = key
|
|
50
|
+
ret.extend(val)
|
|
51
|
+
else:
|
|
52
|
+
ret.append(value.pop(0))
|
|
53
|
+
return ret.decode("utf-8", errors="strict")
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
from ..cosem_interface_classes import cosem_interface_class as ic, attr_indexes as ai
|
|
2
|
-
from ..cosem_interface_classes.overview import ClassID
|
|
3
|
-
from ..types import common_data_types as cdt, cosem_service_types as cst, useful_types as ut
|
|
1
|
+
from ..cosem_interface_classes import cosem_interface_class as ic, attr_indexes as ai
|
|
2
|
+
from ..cosem_interface_classes.overview import ClassID
|
|
3
|
+
from ..types import common_data_types as cdt, cosem_service_types as cst, useful_types as ut
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
from . import collection, implementations as ic_impl, cosem_interface_class as ic
|
|
1
|
+
from . import collection, implementations as ic_impl, cosem_interface_class as ic
|
|
2
2
|
from .parameter import Parameter
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from typing import ClassVar
|
|
3
|
-
from typing_extensions import deprecated
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
@deprecated("use <Parameter>")
|
|
7
|
-
@dataclass
|
|
8
|
-
class AParameter:
|
|
9
|
-
value: ClassVar[bytes]
|
|
10
|
-
|
|
11
|
-
@property
|
|
12
|
-
def i(self) -> int:
|
|
13
|
-
return self.value[6]
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@dataclass
|
|
17
|
-
class Time(AParameter):
|
|
18
|
-
value = b'\x00\x00\x01\x00\x00\xff\x02'
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import ClassVar
|
|
3
|
+
from typing_extensions import deprecated
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@deprecated("use <Parameter>")
|
|
7
|
+
@dataclass
|
|
8
|
+
class AParameter:
|
|
9
|
+
value: ClassVar[bytes]
|
|
10
|
+
|
|
11
|
+
@property
|
|
12
|
+
def i(self) -> int:
|
|
13
|
+
return self.value[6]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class Time(AParameter):
|
|
18
|
+
value = b'\x00\x00\x01\x00\x00\xff\x02'
|
|
19
|
+
|
|
20
|
+
|