pyarmor.cli 9.2.6__3-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.
- pyarmor/cli/__init__.py +46 -0
- pyarmor/cli/__main__.py +812 -0
- pyarmor/cli/batch.py +62 -0
- pyarmor/cli/bootstrap.py +207 -0
- pyarmor/cli/bug.py +137 -0
- pyarmor/cli/command.py +563 -0
- pyarmor/cli/config.py +306 -0
- pyarmor/cli/context.py +790 -0
- pyarmor/cli/core.data.1 +0 -0
- pyarmor/cli/core.data.2 +0 -0
- pyarmor/cli/core.data.3 +0 -0
- pyarmor/cli/default.cfg +564 -0
- pyarmor/cli/docker.py +192 -0
- pyarmor/cli/generate.py +256 -0
- pyarmor/cli/hdinfo.py +81 -0
- pyarmor/cli/merge.py +232 -0
- pyarmor/cli/mixer.py +109 -0
- pyarmor/cli/model.py +460 -0
- pyarmor/cli/plugin.py +292 -0
- pyarmor/cli/project.py +1281 -0
- pyarmor/cli/public_capsule.zip +0 -0
- pyarmor/cli/register.py +1093 -0
- pyarmor/cli/repack.py +793 -0
- pyarmor/cli/resource.py +265 -0
- pyarmor/cli/shell.py +481 -0
- pyarmor_cli-9.2.6.dist-info/METADATA +74 -0
- pyarmor_cli-9.2.6.dist-info/RECORD +30 -0
- pyarmor_cli-9.2.6.dist-info/WHEEL +6 -0
- pyarmor_cli-9.2.6.dist-info/entry_points.txt +3 -0
- pyarmor_cli-9.2.6.dist-info/top_level.txt +1 -0
pyarmor/cli/__init__.py
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
__VERSION__ = '9.2.6'
|
|
4
|
+
|
|
5
|
+
logger = logging.getLogger('cli')
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CliError(Exception):
|
|
9
|
+
pass
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def resoptions(meth):
|
|
13
|
+
|
|
14
|
+
def process(self, res, *args, **kwargs):
|
|
15
|
+
self._options = self.ctx.get_res_options(res.fullname, self._Catalog)
|
|
16
|
+
return meth(self, res, *args, **kwargs)
|
|
17
|
+
|
|
18
|
+
return process
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class Component(object):
|
|
22
|
+
|
|
23
|
+
def __init__(self, ctx):
|
|
24
|
+
self.ctx = ctx
|
|
25
|
+
self._options = {}
|
|
26
|
+
|
|
27
|
+
self.logger = logging.getLogger(self.LOGNAME)
|
|
28
|
+
|
|
29
|
+
def __getattr__(self, opt):
|
|
30
|
+
if opt.startswith('o_'):
|
|
31
|
+
return self._options.get(opt[2:], '')
|
|
32
|
+
elif opt.startswith('oi_'):
|
|
33
|
+
return int(self._options.get(opt[3:]))
|
|
34
|
+
elif opt.startswith('ob_'):
|
|
35
|
+
v = self._options.get(opt[3:], '')
|
|
36
|
+
if isinstance(v, str):
|
|
37
|
+
if v.isdigit():
|
|
38
|
+
return bool(int(v))
|
|
39
|
+
return v.lower() in ('1', 'true', 'on', 'yes')
|
|
40
|
+
|
|
41
|
+
return v
|
|
42
|
+
return AttributeError(opt)
|
|
43
|
+
|
|
44
|
+
def trace(self, res, node, value):
|
|
45
|
+
lineno = getattr(node, 'lineno', -1)
|
|
46
|
+
self.logger.info('%s:%s:%s', res.fullname, lineno, value)
|