aridity 79__tar.gz → 81__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.
- {aridity-79 → aridity-81}/PKG-INFO +2 -2
- {aridity-79 → aridity-81}/README.md +1 -1
- {aridity-79 → aridity-81}/aridity/config.py +3 -4
- {aridity-79 → aridity-81}/aridity/directives.py +1 -1
- {aridity-79 → aridity-81}/aridity/functions.py +2 -3
- {aridity-79 → aridity-81}/aridity/model.py +9 -13
- {aridity-79 → aridity-81}/aridity/scope.py +2 -1
- {aridity-79 → aridity-81}/aridity/util.py +0 -1
- {aridity-79 → aridity-81}/aridity.egg-info/PKG-INFO +2 -2
- {aridity-79 → aridity-81}/aridity.egg-info/SOURCES.txt +0 -1
- {aridity-79 → aridity-81}/setup.cfg +0 -3
- {aridity-79 → aridity-81}/setup.py +1 -1
- {aridity-79 → aridity-81}/aridity/__init__.py +0 -0
- {aridity-79 → aridity-81}/aridity/arid_config.py +0 -0
- {aridity-79 → aridity-81}/aridity/grammar.py +0 -0
- {aridity-79 → aridity-81}/aridity/keyring.py +0 -0
- {aridity-79 → aridity-81}/aridity/processtemplate.py +0 -0
- {aridity-79 → aridity-81}/aridity/repl.py +0 -0
- {aridity-79 → aridity-81}/aridity/resolve.py +0 -0
- {aridity-79 → aridity-81}/aridity/search.py +0 -0
- {aridity-79 → aridity-81}/aridity/stacks.py +0 -0
- {aridity-79 → aridity-81}/aridity.egg-info/dependency_links.txt +0 -0
- {aridity-79 → aridity-81}/aridity.egg-info/entry_points.txt +0 -0
- {aridity-79 → aridity-81}/aridity.egg-info/requires.txt +0 -0
- {aridity-79 → aridity-81}/aridity.egg-info/top_level.txt +0 -0
- {aridity-79 → aridity-81}/parabject.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aridity
|
|
3
|
-
Version:
|
|
3
|
+
Version: 81
|
|
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
|
|
@@ -23,7 +23,7 @@ def main():
|
|
|
23
23
|
config = ConfigCtrl().loadappconfig(main, 'dbtool.arid')
|
|
24
24
|
print(config.dbhost)
|
|
25
25
|
```
|
|
26
|
-
|
|
26
|
+
Base config file `dbtool.arid` as sibling of main module, self-documenting that `dbhost` should be configured:
|
|
27
27
|
```
|
|
28
28
|
dbhost = $(void)
|
|
29
29
|
```
|
|
@@ -11,7 +11,7 @@ def main():
|
|
|
11
11
|
config = ConfigCtrl().loadappconfig(main, 'dbtool.arid')
|
|
12
12
|
print(config.dbhost)
|
|
13
13
|
```
|
|
14
|
-
|
|
14
|
+
Base config file `dbtool.arid` as sibling of main module, self-documenting that `dbhost` should be configured:
|
|
15
15
|
```
|
|
16
16
|
dbhost = $(void)
|
|
17
17
|
```
|
|
@@ -146,12 +146,11 @@ class ConfigCtrl:
|
|
|
146
146
|
def processtemplate(self, frompathorstream, topathorstream):
|
|
147
147
|
'Evaluate expression from path/stream and write result to path/stream.'
|
|
148
148
|
s = self.scope()
|
|
149
|
-
|
|
149
|
+
obj = _wrappathorstream(frompathorstream).processtemplate(s)
|
|
150
150
|
if getattr(topathorstream, 'writable', lambda: False)():
|
|
151
|
-
topathorstream.write(
|
|
151
|
+
topathorstream.write(obj.cat())
|
|
152
152
|
else:
|
|
153
|
-
|
|
154
|
-
g.write(text)
|
|
153
|
+
obj.writeout(topathorstream)
|
|
155
154
|
|
|
156
155
|
def freectrl(self):
|
|
157
156
|
return self._of(self.scope()) # XXX: Strict?
|
|
@@ -94,4 +94,4 @@ class Cat:
|
|
|
94
94
|
name = '<'
|
|
95
95
|
def __call__(self, prefix, suffix, scope):
|
|
96
96
|
scope = scope.getorcreatesubscope(prefix.topath(scope))
|
|
97
|
-
scope.resolved('stdout').flush(suffix.tophrase().resolve(scope).openable(scope).processtemplate(scope))
|
|
97
|
+
scope.resolved('stdout').flush(suffix.tophrase().resolve(scope).openable(scope).processtemplate(scope).cat())
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
from __future__ import division
|
|
2
1
|
from .model import Boolean, Hole, Number, Resource, Text, wrap
|
|
3
2
|
from .util import allfunctions, dotpy, NoSuchPathException, realname
|
|
4
3
|
from importlib import import_module
|
|
@@ -192,7 +191,7 @@ class Functions:
|
|
|
192
191
|
|
|
193
192
|
def processtemplate(scope, resolvable):
|
|
194
193
|
'Evaluate the content of the given path as an expression.'
|
|
195
|
-
return
|
|
194
|
+
return resolvable.resolve(scope).openable(scope).processtemplate(scope)
|
|
196
195
|
|
|
197
196
|
def lower(scope, resolvable):
|
|
198
197
|
return Text(resolvable.resolve(scope).cat().lower())
|
|
@@ -248,7 +247,7 @@ class Functions:
|
|
|
248
247
|
return Text(''.join(chain(lines[:1], (indent + line for line in lines[1:]))))
|
|
249
248
|
|
|
250
249
|
def hole(scope, resolvable):
|
|
251
|
-
return Hole('', resolvable.resolve(scope).cat())
|
|
250
|
+
return Hole(Text(''), resolvable.resolve(scope).cat())
|
|
252
251
|
|
|
253
252
|
def getimpl(scope, *resolvables, **kwargs):
|
|
254
253
|
return scope.resolved(*(r.resolve(scope).cat() for r in resolvables), **kwargs)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
from
|
|
2
|
-
from .util import dotpy, ispy2
|
|
1
|
+
from .util import dotpy
|
|
3
2
|
from contextlib import contextmanager
|
|
4
3
|
from importlib import import_module
|
|
5
|
-
from io import
|
|
4
|
+
from io import TextIOWrapper
|
|
6
5
|
from itertools import chain, islice
|
|
7
6
|
from parabject import dereference, UnknownParabjectException
|
|
8
7
|
import importlib_resources, numbers, os
|
|
@@ -70,7 +69,7 @@ class Concat(Resolvable):
|
|
|
70
69
|
text = obj.cat()
|
|
71
70
|
negtext = ''
|
|
72
71
|
else:
|
|
73
|
-
text = obj.prefix
|
|
72
|
+
text = obj.prefix.textvalue
|
|
74
73
|
k = min(len(negbuffer), len(text))
|
|
75
74
|
if k:
|
|
76
75
|
assert negbuffer[:k] == text[:k]
|
|
@@ -78,9 +77,9 @@ class Concat(Resolvable):
|
|
|
78
77
|
text = text[k:]
|
|
79
78
|
buffer.append(text)
|
|
80
79
|
self.monitor(text)
|
|
81
|
-
negbuffer
|
|
82
|
-
buffer = ''.join(buffer)
|
|
83
|
-
return Hole(buffer, negbuffer) if negbuffer else
|
|
80
|
+
negbuffer = negtext + negbuffer
|
|
81
|
+
buffer = Text(''.join(buffer))
|
|
82
|
+
return Hole(buffer, negbuffer) if negbuffer else buffer
|
|
84
83
|
|
|
85
84
|
def unparse(self):
|
|
86
85
|
return ''.join(part.unparse() for part in self.parts)
|
|
@@ -249,11 +248,8 @@ class Resource(Resolved, Openable):
|
|
|
249
248
|
path = importlib_resources.files(package)
|
|
250
249
|
for name in self._resource_words():
|
|
251
250
|
path /= name
|
|
252
|
-
with path.open('rb') as f:
|
|
253
|
-
|
|
254
|
-
f = BytesIO(f.read())
|
|
255
|
-
with TextIOWrapper(f, self.encoding) as f:
|
|
256
|
-
yield f
|
|
251
|
+
with path.open('rb') as f, TextIOWrapper(f, self.encoding) as g:
|
|
252
|
+
yield g
|
|
257
253
|
|
|
258
254
|
def slash(self, words, rstrip):
|
|
259
255
|
v = list(chain(self._resource_words()[:-1 if rstrip else None], words))
|
|
@@ -395,7 +391,7 @@ class Stream(Resolved):
|
|
|
395
391
|
def processtemplate(self, scope):
|
|
396
392
|
from .grammar import templateparser
|
|
397
393
|
with scope.staticscope().indent.push() as monitor:
|
|
398
|
-
return templateparser(monitor)(self.streamvalue.read()).resolve(scope)
|
|
394
|
+
return templateparser(monitor)(self.streamvalue.read()).resolve(scope)
|
|
399
395
|
|
|
400
396
|
class Entry(Struct):
|
|
401
397
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from . import directives
|
|
2
2
|
from .directives import Precedence
|
|
3
3
|
from .functions import getfunctions, getimpl, OpaqueKey
|
|
4
|
-
from .model import CatNotSupportedException, Directive, Function, Resolvable, Scalar, star, Stream, Text
|
|
4
|
+
from .model import CatNotSupportedException, Directive, Function, Hole, Resolvable, Scalar, star, Stream, Text
|
|
5
5
|
from .resolve import AnchorResolveContext
|
|
6
6
|
from .search import Query
|
|
7
7
|
from .stacks import IndentStack, SimpleStack, ThreadLocalResolvable
|
|
@@ -230,6 +230,7 @@ class StaticScope(AbstractScope):
|
|
|
230
230
|
self['/',] = Slash()
|
|
231
231
|
self['*',] = Star()
|
|
232
232
|
self['None',] = Scalar(None)
|
|
233
|
+
self['eolhole',] = Hole(Text(''), '\n')
|
|
233
234
|
for name in self.stacktypes:
|
|
234
235
|
self[name,] = ThreadLocalResolvable(self.threadlocals, name)
|
|
235
236
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: aridity
|
|
3
|
-
Version:
|
|
3
|
+
Version: 81
|
|
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
|
|
@@ -23,7 +23,7 @@ def main():
|
|
|
23
23
|
config = ConfigCtrl().loadappconfig(main, 'dbtool.arid')
|
|
24
24
|
print(config.dbhost)
|
|
25
25
|
```
|
|
26
|
-
|
|
26
|
+
Base config file `dbtool.arid` as sibling of main module, self-documenting that `dbhost` should be configured:
|
|
27
27
|
```
|
|
28
28
|
dbhost = $(void)
|
|
29
29
|
```
|
|
@@ -49,7 +49,7 @@ class SourceInfo:
|
|
|
49
49
|
sourceinfo = SourceInfo('.')
|
|
50
50
|
setup(
|
|
51
51
|
name = 'aridity',
|
|
52
|
-
version = '
|
|
52
|
+
version = '81',
|
|
53
53
|
description = 'DRY config and template system, easily extensible with Python',
|
|
54
54
|
url = 'https://pypi.org/project/aridity/',
|
|
55
55
|
author = 'foyono',
|
|
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
|