PySimultan 0.4.10__py3-none-any.whl → 0.4.12__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
PySimultan2/__about__.py CHANGED
@@ -1 +1 @@
1
- version = '0.4.10'
1
+ version = '0.4.12'
@@ -40,6 +40,8 @@ class PythonMapper(object):
40
40
 
41
41
  def __init__(self, *args, **kwargs):
42
42
 
43
+ self._mapped_classes = {}
44
+
43
45
  self.name = kwargs.get('name', 'PythonMapper')
44
46
  self.registered_classes: dict[str: SimultanObject] = copy(default_registered_classes) # dict with all registered classes: {taxonomy: class}
45
47
 
@@ -58,6 +60,19 @@ class PythonMapper(object):
58
60
  self.re_register = False
59
61
  self.load_undefined = False
60
62
 
63
+ @property
64
+ def mapped_classes(self):
65
+ if len(self.registered_classes) > len(self._mapped_classes):
66
+ for taxonomy in self.registered_classes.keys():
67
+ if self._mapped_classes.get(taxonomy, None) is None:
68
+ self.create_mapped_class(taxonomy, self.registered_classes[taxonomy])
69
+
70
+ return self._mapped_classes
71
+
72
+ @mapped_classes.setter
73
+ def mapped_classes(self, value):
74
+ self._mapped_classes = value
75
+
61
76
  def register(self, taxonomy, cls, taxonomy_map=None):
62
77
  if not self.re_register and taxonomy in self.registered_classes.keys():
63
78
  return
@@ -71,6 +86,8 @@ class PythonMapper(object):
71
86
  self.registered_classes[taxonomy] = cls
72
87
  self.taxonomy_maps[taxonomy] = taxonomy_map
73
88
 
89
+ return self.get_mapped_class(taxonomy)
90
+
74
91
  def create_mapped_class(self, taxonomy, cls):
75
92
 
76
93
  if any([issubclass(cls, x) for x in (SimultanObject, UserList)]):
@@ -93,7 +110,7 @@ class PythonMapper(object):
93
110
  new_class_dict.update(self.get_properties(taxonomy))
94
111
  new_class = type(cls.__name__, bases, new_class_dict)
95
112
 
96
- self.mapped_classes[taxonomy] = new_class
113
+ self._mapped_classes[taxonomy] = new_class
97
114
 
98
115
  return new_class
99
116
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: PySimultan
3
- Version: 0.4.10
3
+ Version: 0.4.12
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
@@ -1,10 +1,10 @@
1
- PySimultan2/__about__.py,sha256=uGUI89PexfWbfIBjG7h1-NiGB_zMz-AA673uKu8hQGE,20
1
+ PySimultan2/__about__.py,sha256=MkMmPeqymacyZEBg90eZ65LwKDDZpJmbjay0tT_M-4Q,20
2
2
  PySimultan2/__init__.py,sha256=cabTN1Oz8xtFM31ouBKg5lwLqW5vtexDP669PYyNLnA,3224
3
3
  PySimultan2/data_model.py,sha256=3O6O2Lw0lQJtlwNa7_NuTjp4gpdHiusjXHyWtmmHtlU,27214
4
4
  PySimultan2/default_types.py,sha256=v_4awsUURLbu4Sfw7J_7BoQKirXbKdU9s7-wqgA4nNE,23112
5
5
  PySimultan2/files.py,sha256=gx3BA6WYjNVplqqes7jkPopp6O50pgLvantXgmitx54,12657
6
6
  PySimultan2/multi_values.py,sha256=ZFXlTLuZo32x7_7diYAp2XEjp5uwgHLgNOzN7v74-5I,13650
7
- PySimultan2/object_mapper.py,sha256=nsLuGT0brMqlSoqxsbTHQQxEdoWvoTVM0APpF4MOdTE,12391
7
+ PySimultan2/object_mapper.py,sha256=_uGFykv3zhlxyezJD1UGesDgnXHNU8uezzLGj69LM7M,12964
8
8
  PySimultan2/simultan_object.py,sha256=Plr9nwgRmKzdkTO7l8ksWekEow9pT-MgjjAfLlChgDI,17208
9
9
  PySimultan2/taxonomy_maps.py,sha256=IYpIat6ZJi5MyCbsjAxWvVOWDRp_VvSMWUY3CApKSik,8061
10
10
  PySimultan2/utils.py,sha256=J3T7KDfONFeLWBulXmGMCaaOu5sfkDSHmI92JWO8dW4,62553
@@ -75,7 +75,7 @@ PySimultan2/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3h
75
75
  PySimultan2/resources/assimp.dll,sha256=HwfDwXqoPDTFRyoQpA3qmgZoUdFtziJkV5fNtktEZEU,6081536
76
76
  PySimultan2/resources/defaultsettings.xml,sha256=s6Tk1tubLz5UYqXZWpD42EDHzedemRY1nEneoIVcUfg,392
77
77
  PySimultan2/resources/setup.bat,sha256=fjvvYfVM6TalS-QTSiKAbAId5nTsk8kGGo06ba-wWaY,32
78
- pysimultan-0.4.10.dist-info/METADATA,sha256=Ga4tRspSlIDPakK5JGea9Ft8APQmCEl-sIm4BuU03Ag,2483
79
- pysimultan-0.4.10.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
80
- pysimultan-0.4.10.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
81
- pysimultan-0.4.10.dist-info/RECORD,,
78
+ pysimultan-0.4.12.dist-info/METADATA,sha256=KuAlLSL--I3f7tTfNUgODVUH6RoRLdx6k8aZJECDkpg,2483
79
+ pysimultan-0.4.12.dist-info/WHEEL,sha256=zEMcRr9Kr03x1ozGwg5v9NQBKn3kndp6LSoSlVg-jhU,87
80
+ pysimultan-0.4.12.dist-info/licenses/LICENSE.txt,sha256=pmSr98k6N005KMojnZxzLGRuRlDjDx3PUrK1lFj53HA,1126
81
+ pysimultan-0.4.12.dist-info/RECORD,,