bare-script 5.1.7__tar.gz → 5.1.8__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.
- {bare_script-5.1.7/src/bare_script.egg-info → bare_script-5.1.8}/PKG-INFO +1 -1
- {bare_script-5.1.7 → bare_script-5.1.8}/pyproject.toml +1 -1
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/bare.py +2 -12
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/include.py +1 -9
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/include_source.py +1554 -1633
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/library.py +23 -68
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/options.py +8 -13
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/runtime.py +145 -119
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/value.py +42 -62
- {bare_script-5.1.7 → bare_script-5.1.8/src/bare_script.egg-info}/PKG-INFO +1 -1
- {bare_script-5.1.7 → bare_script-5.1.8}/LICENSE +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/README.md +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/setup.cfg +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/setup.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/__init__.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/__main__.py +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script/runtime_c.c +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/SOURCES.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/dependency_links.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/entry_points.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/requires.txt +0 -0
- {bare_script-5.1.7 → bare_script-5.1.8}/src/bare_script.egg-info/top_level.txt +0 -0
|
@@ -7,20 +7,13 @@ bare-script command-line interface (CLI)
|
|
|
7
7
|
|
|
8
8
|
import argparse
|
|
9
9
|
from functools import partial
|
|
10
|
-
import os
|
|
11
10
|
import sys
|
|
12
11
|
import time
|
|
13
12
|
|
|
13
|
+
from . import evaluate_expression, execute_script
|
|
14
14
|
from .options import fetch_read_write, log_stdout, url_file_relative
|
|
15
15
|
from .runtime import SYSTEM_GLOBAL_INCLUDES_NAME, barescript_lint_script, barescript_parse_expression, barescript_parse_script
|
|
16
16
|
from .value import value_boolean
|
|
17
|
-
if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
|
|
18
|
-
try:
|
|
19
|
-
from .runtime_c import evaluate_expression, execute_script
|
|
20
|
-
except ImportError:
|
|
21
|
-
from .runtime import evaluate_expression, execute_script
|
|
22
|
-
else:
|
|
23
|
-
from .runtime import evaluate_expression, execute_script
|
|
24
17
|
|
|
25
18
|
|
|
26
19
|
def main(argv=None):
|
|
@@ -33,6 +26,7 @@ def main(argv=None):
|
|
|
33
26
|
if sys.version_info >= (3, 14): # pragma: no cover
|
|
34
27
|
argument_parser_args['color'] = False
|
|
35
28
|
parser = argparse.ArgumentParser(**argument_parser_args)
|
|
29
|
+
parser.set_defaults(scripts=[])
|
|
36
30
|
parser.add_argument('file', nargs='*', action=_FileScriptAction, help='files to process')
|
|
37
31
|
parser.add_argument('-c', '--code', action=_InlineScriptAction, help='execute the BareScript code')
|
|
38
32
|
parser.add_argument('-d', '--debug', action='store_true', help='enable debug mode')
|
|
@@ -159,13 +153,9 @@ def main(argv=None):
|
|
|
159
153
|
|
|
160
154
|
class _InlineScriptAction(argparse.Action):
|
|
161
155
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
162
|
-
if 'scripts' not in namespace:
|
|
163
|
-
setattr(namespace, 'scripts', [])
|
|
164
156
|
namespace.scripts.append(('code', values))
|
|
165
157
|
|
|
166
158
|
|
|
167
159
|
class _FileScriptAction(argparse.Action):
|
|
168
160
|
def __call__(self, parser, namespace, values, option_string=None):
|
|
169
|
-
if 'scripts' not in namespace:
|
|
170
|
-
setattr(namespace, 'scripts', [])
|
|
171
161
|
namespace.scripts.extend(('file', value) for value in values)
|
|
@@ -5,15 +5,7 @@
|
|
|
5
5
|
Include library script globals and native stub functions
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
if not os.environ.get('BARESCRIPT_RUNTIME_PY'): # pragma: no cover
|
|
11
|
-
try:
|
|
12
|
-
from .runtime_c import execute_script
|
|
13
|
-
except ImportError:
|
|
14
|
-
from .runtime import execute_script
|
|
15
|
-
else:
|
|
16
|
-
from .runtime import execute_script
|
|
8
|
+
from . import execute_script
|
|
17
9
|
|
|
18
10
|
|
|
19
11
|
# The include library script globals - execute the include library script
|