aridity 72__tar.gz → 73__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aridity
3
- Version: 72
3
+ Version: 73
4
4
  Summary: DRY config and template system, easily extensible with Python
5
5
  Home-page: https://pypi.org/project/aridity/
6
6
  Author: foyono
@@ -724,10 +724,10 @@ Assert exactly one object in the given sequence and return it.
724
724
  ###### register
725
725
 
726
726
  ```python
727
- def register(obj, parabject)
727
+ def register(obj, paracls)
728
728
  ```
729
729
 
730
- Set `obj` to be the regular object associated with the given parabject.
730
+ Instantiate paracls, set `obj` to be the regular object associated with the new parabject, and return the parabject.
731
731
 
732
732
  <a id="parabject.dereference"></a>
733
733
 
@@ -712,10 +712,10 @@ Assert exactly one object in the given sequence and return it.
712
712
  ###### register
713
713
 
714
714
  ```python
715
- def register(obj, parabject)
715
+ def register(obj, paracls)
716
716
  ```
717
717
 
718
- Set `obj` to be the regular object associated with the given parabject.
718
+ Instantiate paracls, set `obj` to be the regular object associated with the new parabject, and return the parabject.
719
719
 
720
720
  <a id="parabject.dereference"></a>
721
721
 
@@ -11,11 +11,6 @@ import errno, logging, os, sys
11
11
 
12
12
  log = logging.getLogger(__name__)
13
13
 
14
- def _newnode(configcls, ctrl):
15
- node = configcls()
16
- register(ctrl, node)
17
- return node
18
-
19
14
  def _processmainfunction(mainfunction):
20
15
  module = mainfunction.__module__
21
16
  if '__main__' == module:
@@ -50,15 +45,15 @@ class ConfigCtrl:
50
45
  @property
51
46
  def r(self):
52
47
  'Get config object for reading, i.e. missing scopes will error.'
53
- return _newnode(RConfig, self)
48
+ return register(self, RConfig)
54
49
 
55
50
  @property
56
51
  def w(self):
57
52
  'Get config object for writing, i.e. missing scopes will be created.'
58
- return _newnode(WConfig, self)
53
+ return register(self, WConfig)
59
54
 
60
55
  def __init__(self, basescope = None, prefix = None):
61
- self.node = _newnode(Config, self)
56
+ self.node = register(self, Config)
62
57
  self.basescope = Scope() if basescope is None else basescope
63
58
  self.prefix = [] if prefix is None else prefix
64
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: aridity
3
- Version: 72
3
+ Version: 73
4
4
  Summary: DRY config and template system, easily extensible with Python
5
5
  Home-page: https://pypi.org/project/aridity/
6
6
  Author: foyono
@@ -724,10 +724,10 @@ Assert exactly one object in the given sequence and return it.
724
724
  ###### register
725
725
 
726
726
  ```python
727
- def register(obj, parabject)
727
+ def register(obj, paracls)
728
728
  ```
729
729
 
730
- Set `obj` to be the regular object associated with the given parabject.
730
+ Instantiate paracls, set `obj` to be the regular object associated with the new parabject, and return the parabject.
731
731
 
732
732
  <a id="parabject.dereference"></a>
733
733
 
@@ -2,9 +2,11 @@ from weakref import WeakKeyDictionary
2
2
 
3
3
  lookup = WeakKeyDictionary()
4
4
 
5
- def register(obj, parabject):
6
- 'Set `obj` to be the regular object associated with the given parabject.'
5
+ def register(obj, paracls):
6
+ 'Instantiate paracls, set `obj` to be the regular object associated with the new parabject, and return the parabject.'
7
+ parabject = paracls()
7
8
  lookup[parabject] = obj
9
+ return parabject
8
10
 
9
11
  class UnknownParabjectException(Exception): pass
10
12
 
@@ -6,7 +6,7 @@ def long_description():
6
6
 
7
7
  setup(
8
8
  name = 'aridity',
9
- version = '72',
9
+ version = '73',
10
10
  description = 'DRY config and template system, easily extensible with Python',
11
11
  long_description = long_description(),
12
12
  long_description_content_type = 'text/markdown',
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