PySimultan 0.5.9.1__py3-none-any.whl → 0.5.9.4__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.
- PySimultan2/CHANGELOG.md +3 -0
- PySimultan2/__about__.py +1 -1
- PySimultan2/files.py +42 -2
- {pysimultan-0.5.9.1.dist-info → pysimultan-0.5.9.4.dist-info}/METADATA +4 -1
- {pysimultan-0.5.9.1.dist-info → pysimultan-0.5.9.4.dist-info}/RECORD +7 -7
- {pysimultan-0.5.9.1.dist-info → pysimultan-0.5.9.4.dist-info}/WHEEL +0 -0
- {pysimultan-0.5.9.1.dist-info → pysimultan-0.5.9.4.dist-info}/licenses/LICENSE.txt +0 -0
PySimultan2/CHANGELOG.md
CHANGED
PySimultan2/__about__.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
version = '0.5.9.
|
1
|
+
version = '0.5.9.4'
|
PySimultan2/files.py
CHANGED
@@ -666,14 +666,54 @@ class DirectoryInfo(object, metaclass=DirectoryInfoMetaMock):
|
|
666
666
|
else:
|
667
667
|
return None
|
668
668
|
|
669
|
-
def add_sub_directory(self,
|
670
|
-
|
669
|
+
def add_sub_directory(self, dirname: str) -> DirectoryInfo:
|
670
|
+
|
671
|
+
existing = next((x for x in self.sub_directories if x.resource_entry.current_relative_path == dirname), None)
|
672
|
+
if existing is not None:
|
673
|
+
return existing
|
674
|
+
|
675
|
+
return DirectoryInfo(path=os.path.join(self.resource_entry.current_relative_path, dirname),
|
671
676
|
data_model=self.data_model)
|
672
677
|
|
678
|
+
def get_sub_directory(self,
|
679
|
+
dirname: str,
|
680
|
+
create=False) -> Optional[DirectoryInfo]:
|
681
|
+
"""
|
682
|
+
Get a sub directory by name.
|
683
|
+
:param dirname: directory name, relative to self.relative_path
|
684
|
+
:param create:
|
685
|
+
:return:
|
686
|
+
"""
|
687
|
+
|
688
|
+
logger.debug(f'Getting sub directory in {self.relative_path}: {dirname}')
|
689
|
+
res = next((x for x in self.sub_directories if x.resource_entry.Name == dirname), None)
|
690
|
+
if not res and create:
|
691
|
+
logger.debug(f'Creating sub directory in {self.relative_path}: {dirname}')
|
692
|
+
res = self.add_sub_directory(dirname)
|
693
|
+
|
694
|
+
return res
|
695
|
+
|
696
|
+
def get_file(self, filename: str) -> Optional[FileInfo]:
|
697
|
+
resource = next((x for x in self.files if x.resource_entry.Name == filename), None)
|
698
|
+
if resource is not None:
|
699
|
+
return FileInfo(resource_entry=entry,
|
700
|
+
data_model=self.data_model)
|
701
|
+
else:
|
702
|
+
return None
|
703
|
+
|
673
704
|
def add_file(self,
|
674
705
|
filename: str,
|
675
706
|
content: Optional[str] = None) -> FileInfo:
|
676
707
|
|
708
|
+
if Path(self.full_path).joinpath(filename).exists():
|
709
|
+
return FileInfo.from_existing_file(str(Path(self.full_path).joinpath(filename)), data_model=self.data_model)
|
710
|
+
|
711
|
+
|
712
|
+
if self.resource_entry.Children:
|
713
|
+
file = self.get_file(filename)
|
714
|
+
if file is not None:
|
715
|
+
return file
|
716
|
+
|
677
717
|
if content is not None:
|
678
718
|
return FileInfo.from_string(filename=filename,
|
679
719
|
content=content,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: PySimultan
|
3
|
-
Version: 0.5.9.
|
3
|
+
Version: 0.5.9.4
|
4
4
|
Project-URL: Documentation, https://github.com/Bühler Maximilian/PySimultan2#readme
|
5
5
|
Project-URL: Issues, https://github.com/Bühler Maximilian/PySimultan2/issues
|
6
6
|
Project-URL: Source, https://github.com/Bühler Maximilian/PySimultan2
|
@@ -167,6 +167,9 @@ print(instances[0].param_1)
|
|
167
167
|
|
168
168
|
# Change Log
|
169
169
|
|
170
|
+
## [0.5.9.4] - 2024-12-31
|
171
|
+
- Fixed bug in DirectoryInfo where \_\_dir_helper_file__ was not found if already existing
|
172
|
+
|
170
173
|
## [0.5.8] - 2024-12-17
|
171
174
|
- Added FileInfo.from_existing_file method to create FileInfo object from existing file in ProjectUnpackFolder
|
172
175
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
PySimultan2/CHANGELOG.md,sha256=
|
2
|
-
PySimultan2/__about__.py,sha256=
|
1
|
+
PySimultan2/CHANGELOG.md,sha256=oibgN_OC1p98_zVtpae5CtPZNLLnpQYd3XGIN0ztniU,484
|
2
|
+
PySimultan2/__about__.py,sha256=wcBZdv_01RfwUsYaNCg6k1n5X_r_lKL6F-5kjjNQTv0,21
|
3
3
|
PySimultan2/__init__.py,sha256=42YM_zQUXdEjbjmgBI0nWJWsr_G6zNe7TxfFmS37mJk,3275
|
4
4
|
PySimultan2/data_model.py,sha256=UcscVLbBaEu9UhV2iaGJnrqX51G5PyEQuoXrz41Hq9g,36126
|
5
5
|
PySimultan2/default_types.py,sha256=K-Eka5BCKk8DT3HU5761Ym_-ZFmu1_Dro0zW0LVGoHA,27157
|
6
|
-
PySimultan2/files.py,sha256=
|
6
|
+
PySimultan2/files.py,sha256=b9Eii3RPx_zKuD09XUndcUrZPEOjYVf1jv2iWDXoWCo,27608
|
7
7
|
PySimultan2/multi_values.py,sha256=ZFXlTLuZo32x7_7diYAp2XEjp5uwgHLgNOzN7v74-5I,13650
|
8
8
|
PySimultan2/object_mapper.py,sha256=_SQye38NmIr4m_-X9CuvUJnVDBmjmUDdPH2bnaxpzKY,18546
|
9
9
|
PySimultan2/simultan_object.py,sha256=akaSUZZWIVfwx1wT5EdOgRR2UeShUthX-LE2Uk6w8CQ,19058
|
@@ -75,7 +75,7 @@ PySimultan2/resources/assimp.dll,sha256=HwfDwXqoPDTFRyoQpA3qmgZoUdFtziJkV5fNtktE
|
|
75
75
|
PySimultan2/resources/componentmanager.user,sha256=hrzr1US4pqkFnLHXcvPkvrgGd7QvlxaV8mhS6fuikEs,760
|
76
76
|
PySimultan2/resources/defaultsettings.xml,sha256=s6Tk1tubLz5UYqXZWpD42EDHzedemRY1nEneoIVcUfg,392
|
77
77
|
PySimultan2/resources/setup.bat,sha256=fjvvYfVM6TalS-QTSiKAbAId5nTsk8kGGo06ba-wWaY,32
|
78
|
-
pysimultan-0.5.9.
|
79
|
-
pysimultan-0.5.9.
|
80
|
-
pysimultan-0.5.9.
|
81
|
-
pysimultan-0.5.9.
|
78
|
+
pysimultan-0.5.9.4.dist-info/METADATA,sha256=zr46P9K9fw5lYkhxEOCHTx7jToKoKxNi_GHX_ATlJOA,6256
|
79
|
+
pysimultan-0.5.9.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
80
|
+
pysimultan-0.5.9.4.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
|
81
|
+
pysimultan-0.5.9.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|