equal
deleted
inserted
replaced
907 self.name = kwargs.get('name',utils.resourceref.to_objref(self.path)) |
907 self.name = kwargs.get('name',utils.resourceref.to_objref(self.path)) |
908 self.version = kwargs.get('version') |
908 self.version = kwargs.get('version') |
909 super(Configuration, self).__init__(utils.resourceref.to_objref(self.path), **kwargs) |
909 super(Configuration, self).__init__(utils.resourceref.to_objref(self.path), **kwargs) |
910 self.container = True |
910 self.container = True |
911 |
911 |
912 def __reduce_ex__(self, protocol_version): |
|
913 """ |
|
914 Make the Configuration pickle a ConfigurationProxy object that would load this configuration |
|
915 """ |
|
916 proxy = ConfigurationProxy(self.path, store_interface = self.get_project()) |
|
917 tpl = proxy.__reduce_ex__(protocol_version) |
|
918 return tpl |
|
919 |
|
920 def __getstate__(self): |
|
921 return None |
|
922 |
|
923 def _default_object(self, name): |
912 def _default_object(self, name): |
924 return self._default_class()(name) |
913 return self._default_class()(name) |
925 |
914 |
926 def _default_class(self): |
915 def _default_class(self): |
927 return self._feature_class() |
916 return self._feature_class() |
1374 The ConfigurationProxy trust to get the store_interface from the parent object with get_storage() function. |
1363 The ConfigurationProxy trust to get the store_interface from the parent object with get_storage() function. |
1375 |
1364 |
1376 """ |
1365 """ |
1377 super(ConfigurationProxy,self).__init__(path, **kwargs) |
1366 super(ConfigurationProxy,self).__init__(path, **kwargs) |
1378 self.set('_name', utils.resourceref.to_objref(path)) |
1367 self.set('_name', utils.resourceref.to_objref(path)) |
1379 |
|
1380 def __reduce_ex__(self, protocol_version): |
|
1381 """ |
|
1382 Make the Configuration pickle a ConfigurationProxy object that would load this configuration |
|
1383 """ |
|
1384 return super(ConfigurationProxy, self).__reduce_ex__(protocol_version) |
|
1385 |
1368 |
1386 def _clone(self, **kwargs): |
1369 def _clone(self, **kwargs): |
1387 """ |
1370 """ |
1388 A ConfigurationProxy specific implementation for cloning. |
1371 A ConfigurationProxy specific implementation for cloning. |
1389 Copies all (public) members in dictionary. |
1372 Copies all (public) members in dictionary. |
1675 |
1658 |
1676 def __getstate__(self): |
1659 def __getstate__(self): |
1677 state = super(Feature, self).__getstate__() |
1660 state = super(Feature, self).__getstate__() |
1678 # remove the dataproxy value so that it is not stored in serializings |
1661 # remove the dataproxy value so that it is not stored in serializings |
1679 state.pop('_dataproxy', None) |
1662 state.pop('_dataproxy', None) |
|
1663 # remove instancemethods so that those are not stored in serializings |
|
1664 state.pop('get_original_value', None) |
|
1665 state.pop('get_value', None) |
|
1666 state.pop('set_value', None) |
|
1667 state.pop('add_feature', None) |
1680 return state |
1668 return state |
1681 |
1669 |
1682 def __setstate__(self, state): |
1670 def __setstate__(self, state): |
1683 super(Feature, self).__setstate__(state) |
1671 super(Feature, self).__setstate__(state) |
1684 self._dataproxy = None |
1672 self._dataproxy = None |
2623 super(FeatureSequenceSub, self).__init__(ref) |
2611 super(FeatureSequenceSub, self).__init__(ref) |
2624 self.name = kwargs.get('name', ref) |
2612 self.name = kwargs.get('name', ref) |
2625 self.type = 'subseq' |
2613 self.type = 'subseq' |
2626 self._index = 0 |
2614 self._index = 0 |
2627 |
2615 |
2628 def __getstate__(self): |
|
2629 state = super(FeatureSequenceSub,self).__getstate__() |
|
2630 state['_children'].pop('?datarows', None) |
|
2631 return state |
|
2632 |
|
2633 def get_index(self): |
2616 def get_index(self): |
2634 """ |
2617 """ |
2635 @return : the index of the data element for sequential data defined inside the same configuration. |
2618 @return : the index of the data element for sequential data defined inside the same configuration. |
2636 0 for normal data. |
2619 0 for normal data. |
2637 """ |
2620 """ |
3343 self.curpath = "" |
3326 self.curpath = "" |
3344 self.container = True |
3327 self.container = True |
3345 self.__opened_res__ = {} |
3328 self.__opened_res__ = {} |
3346 self.mode = mode |
3329 self.mode = mode |
3347 self.cpath_stack = [] |
3330 self.cpath_stack = [] |
3348 |
|
3349 def __reduce_ex__(self, protocol_version): |
|
3350 return (open_storage, |
|
3351 (self.path, self.mode), |
|
3352 None, |
|
3353 None, |
|
3354 None) |
|
3355 |
3331 |
3356 def __opened__(self, res): |
3332 def __opened__(self, res): |
3357 """ |
3333 """ |
3358 Internal function to add a newly opened Resource object to the list of open resources. |
3334 Internal function to add a newly opened Resource object to the list of open resources. |
3359 @param res: The resource object |
3335 @param res: The resource object |