g3projects 0.2.3__tar.gz → 0.2.4__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.
- {g3projects-0.2.3 → g3projects-0.2.4}/PKG-INFO +1 -1
- {g3projects-0.2.3 → g3projects-0.2.4}/pyproject.toml +1 -1
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/main/_main.py +24 -3
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/_physical.py +7 -5
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/config_sfdomain.tpl +1 -1
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/PKG-INFO +1 -1
- {g3projects-0.2.3 → g3projects-0.2.4}/LICENCE +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/README.md +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/setup.cfg +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/__init__.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/__init__.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/_logical.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/ansic_prg.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/autogenerated_block.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/config_txt.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/main_c.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/main_c_system.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_logical.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_project.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_system.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/variables_var.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/variables_var_system.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/main/__init__.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/__init__.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/config_pkg.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/cpu_pkg.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/hardware_hw.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/iomap_iom.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/physical_pkg.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/physical/templates/zone_sw.tpl +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/py.typed +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/utils/__init__.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/utils/_utils.py +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/SOURCES.txt +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/dependency_links.txt +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/entry_points.txt +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/requires.txt +0 -0
- {g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects.egg-info/top_level.txt +0 -0
|
@@ -46,6 +46,24 @@ def parse_arguments() -> argparse.Namespace:
|
|
|
46
46
|
'to the control devices. This option requires --gen-logical.'
|
|
47
47
|
)
|
|
48
48
|
)
|
|
49
|
+
parser.add_argument(
|
|
50
|
+
"--ftp1-pswd-hash",
|
|
51
|
+
type=str,
|
|
52
|
+
required=False,
|
|
53
|
+
help="'ftp' user password hash for PLC FTP server",
|
|
54
|
+
)
|
|
55
|
+
parser.add_argument(
|
|
56
|
+
"--ftp2-pswd-hash",
|
|
57
|
+
type=str,
|
|
58
|
+
required=False,
|
|
59
|
+
help="'ellmaster' user password hash for PLC FTP server",
|
|
60
|
+
)
|
|
61
|
+
parser.add_argument(
|
|
62
|
+
"--sfdomain_pswd_hash",
|
|
63
|
+
type=str,
|
|
64
|
+
required=False,
|
|
65
|
+
help="SafeDomain password hash",
|
|
66
|
+
)
|
|
49
67
|
parser.add_argument(
|
|
50
68
|
'--log-level',
|
|
51
69
|
type=str,
|
|
@@ -67,12 +85,15 @@ def generate_project_files(
|
|
|
67
85
|
system_config_path: str,
|
|
68
86
|
gen_physical: bool = True,
|
|
69
87
|
gen_logical: bool = True,
|
|
70
|
-
gen_test: bool = False
|
|
88
|
+
gen_test: bool = False,
|
|
89
|
+
ftp1_pswd_hash: str = '',
|
|
90
|
+
ftp2_pswd_hash: str = '',
|
|
91
|
+
sfdomain_pswd_hash: str = ''
|
|
71
92
|
) -> None:
|
|
72
93
|
if gen_logical:
|
|
73
94
|
generate_logical_files(system_config_path, gen_test)
|
|
74
95
|
if gen_physical:
|
|
75
|
-
generate_physical_files(system_config_path)
|
|
96
|
+
generate_physical_files(system_config_path, ftp1_pswd_hash, ftp2_pswd_hash, sfdomain_pswd_hash)
|
|
76
97
|
|
|
77
98
|
|
|
78
99
|
def main() -> None:
|
|
@@ -82,5 +103,5 @@ def main() -> None:
|
|
|
82
103
|
format='[%(name)s] %(levelname)s:%(message)s'
|
|
83
104
|
)
|
|
84
105
|
generate_project_files(
|
|
85
|
-
args.system_config, args.gen_physical, args.gen_logical, args.gen_test
|
|
106
|
+
args.system_config, args.gen_physical, args.gen_logical, args.gen_test, args.ftp1_pswd_hash, args.ftp2_pswd_hash, args.sfdomain_pswd_hash
|
|
86
107
|
)
|
|
@@ -118,12 +118,14 @@ def create_hw_isles(config_hw: dict, **kwargs) -> HardwareIsle | None:
|
|
|
118
118
|
|
|
119
119
|
|
|
120
120
|
def generate_hardware_hw_contents(
|
|
121
|
-
config_hw: dict, system_name: str, cp1584_name: str
|
|
121
|
+
config_hw: dict, system_name: str, cp1584_name: str, ftp1_pswd_hash: str, ftp2_pswd_hash: str
|
|
122
122
|
) -> str:
|
|
123
123
|
kwargs = {
|
|
124
124
|
'cpuname': cp1584_name,
|
|
125
125
|
'cpuhostname': system_name,
|
|
126
|
-
'cpuconfigurationid': system_name
|
|
126
|
+
'cpuconfigurationid': system_name,
|
|
127
|
+
'ftpuserpassword1': ftp1_pswd_hash,
|
|
128
|
+
'ftpuserpassword2': ftp2_pswd_hash
|
|
127
129
|
}
|
|
128
130
|
if not (hw_isle := create_hw_isles(config_hw, **kwargs)):
|
|
129
131
|
return ''
|
|
@@ -175,7 +177,7 @@ def generate_iomap_iom_contents(system: SWSystemDictWrapper) -> list[str]:
|
|
|
175
177
|
# END Iomap.iom #
|
|
176
178
|
|
|
177
179
|
|
|
178
|
-
def generate_physical_files(system_config_path: str) -> None:
|
|
180
|
+
def generate_physical_files(system_config_path: str, ftp1_pswd_hash: str, ftp2_pswd_hash: str, sfdomain_pswd_hash: str) -> None:
|
|
179
181
|
system = get_system_dict(system_config_path)
|
|
180
182
|
sw_system_wrapper = SWSystemDictWrapper(system['Software'])
|
|
181
183
|
project_name = sw_system_wrapper.get_project_name()
|
|
@@ -200,7 +202,7 @@ def generate_physical_files(system_config_path: str) -> None:
|
|
|
200
202
|
'cp1584', system['Hardware'] # type: ignore
|
|
201
203
|
)
|
|
202
204
|
hardware_hw = generate_hardware_hw_contents(
|
|
203
|
-
system['Hardware'], system_name, cpu_name # type: ignore
|
|
205
|
+
system['Hardware'], system_name, cpu_name, ftp1_pswd_hash, ftp2_pswd_hash # type: ignore
|
|
204
206
|
)
|
|
205
207
|
except ValueError:
|
|
206
208
|
logger.warning(
|
|
@@ -249,7 +251,7 @@ def generate_physical_files(system_config_path: str) -> None:
|
|
|
249
251
|
write_to_file(
|
|
250
252
|
mapp_safety_path_dst,
|
|
251
253
|
'Config.sfdomain',
|
|
252
|
-
format_template(env, 'config_sfdomain.tpl', sl8101_name=sl_name)
|
|
254
|
+
format_template(env, 'config_sfdomain.tpl', sl8101_name=sl_name, sfdomainpassword=sfdomain_pswd_hash)
|
|
253
255
|
)
|
|
254
256
|
# create IoMap.iom file
|
|
255
257
|
iomap = generate_iomap_iom_contents(sw_system_wrapper)
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<Property ID="SafeLOGICName" Value="{{ sl8101_name }}" />
|
|
11
11
|
<Property ID="SafeLOGICProductId" Value="X20cSL8101" />
|
|
12
12
|
<Property ID="SafeLOGICModulePath" Value="IF3.ST32" />
|
|
13
|
-
<Property ID="Password" Value="
|
|
13
|
+
<Property ID="Password" Value="{{ sfdomainpassword }}" />
|
|
14
14
|
<Property ID="SafeProject" Value="safeZone" />
|
|
15
15
|
</Group>
|
|
16
16
|
<Group ID="DefaultFiles">
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/autogenerated_block.tpl
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_logical.tpl
RENAMED
|
File without changes
|
{g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_project.tpl
RENAMED
|
File without changes
|
{g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/package_pkg_system.tpl
RENAMED
|
File without changes
|
|
File without changes
|
{g3projects-0.2.3 → g3projects-0.2.4}/src/g3projects/logical/templates/variables_var_system.tpl
RENAMED
|
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
|