omdev 0.0.0.dev139__tar.gz → 0.0.0.dev141__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.
Potentially problematic release.
This version of omdev might be problematic. Click here for more details.
- {omdev-0.0.0.dev139/omdev.egg-info → omdev-0.0.0.dev141}/PKG-INFO +2 -2
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/.manifests.json +12 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/interp.py +7 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/pyproject.py +7 -0
- omdev-0.0.0.dev141/omdev/tools/cloc.py +149 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141/omdev.egg-info}/PKG-INFO +2 -2
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev.egg-info/SOURCES.txt +1 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev.egg-info/requires.txt +1 -1
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/pyproject.toml +2 -2
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/LICENSE +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/MANIFEST.in +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/README.rst +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/__about__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/amalg/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/amalg/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/amalg/amalg.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/antlr/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/antlr/consts.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/antlr/gen.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/bracepy.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/cache.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/contexts.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/currents.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/fns.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/resolvers.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/storage.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/compute/types.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/actions.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/cache.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/consts.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/defaults.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/manifests.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cache/data/specs.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_boilerplate.cc +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/LICENSE +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/build_ext.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/compilers/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/compilers/ccompiler.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/compilers/options.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/compilers/unixccompiler.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/dir_util.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/errors.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/extension.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/file_util.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/modified.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/spawn.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/sysconfig.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/util.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/_distutils/version.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/build.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/cmake.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/importhook.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/magic.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cexts/scan.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/classdot.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/_pathhack.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/clicli.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/install.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/main.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/managers.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cli/types.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/clipboard/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/clipboard/clipboard.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/clipboard/darwin_cf.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/clipboard/linux_x11.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/cmake.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/findimports.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/git.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/imgur.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/cli.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/inspect.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/providers.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/pyenv.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/resolvers.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/standalone.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/system.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/interp/types.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/cli.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/formats.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/io.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/parsing.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/processing.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/json/rendering.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/magic/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/magic/find.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/magic/magic.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/magic/prepare.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/magic/styles.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/manifests/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/manifests/build.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/manifests/load.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/manifests/types.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/mypy/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/mypy/debug.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/marshal.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/names.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/requires.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/specifiers.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/packaging/versions.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pip.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/base.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/git.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/lite.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/main.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/manifests.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/precheck/scripts.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/ptk/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/ptk/apps/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/ptk/apps/ncdu.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pycharm/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pycharm/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pycharm/cli.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/cexts.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/cli.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/configs.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/pkg.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/pyproject/reqs.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/revisions.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/bumpversion.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/execrss.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/exectime.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/importtrace.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/slowcat.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/scripts/tmpexec.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/secrets.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tokens.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/toml/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/toml/parser.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/toml/writer.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/doc.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/docker.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/git.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/importscan.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/mkrelimp.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/notebook.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/pawk/__init__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/pawk/__main__.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/pawk/pawk.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/pip.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/prof.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/qr.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/tools/sqlrepl.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev/wheelfile.py +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev.egg-info/dependency_links.txt +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev.egg-info/entry_points.txt +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/omdev.egg-info/top_level.txt +0 -0
- {omdev-0.0.0.dev139 → omdev-0.0.0.dev141}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev141
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: >=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
|
15
|
+
Requires-Dist: omlish==0.0.0.dev141
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: black~=24.10; extra == "all"
|
|
18
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
@@ -230,6 +230,18 @@
|
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
232
|
},
|
|
233
|
+
{
|
|
234
|
+
"module": ".tools.cloc",
|
|
235
|
+
"attr": "_CLI_MODULE",
|
|
236
|
+
"file": "omdev/tools/cloc.py",
|
|
237
|
+
"line": 144,
|
|
238
|
+
"value": {
|
|
239
|
+
"$.cli.types.CliModule": {
|
|
240
|
+
"cmd_name": "cloc",
|
|
241
|
+
"mod_name": "omdev.tools.cloc"
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
},
|
|
233
245
|
{
|
|
234
246
|
"module": ".tools.doc",
|
|
235
247
|
"attr": "_CLI_MODULE",
|
|
@@ -53,6 +53,7 @@ VersionComparisonMethod = ta.Callable[[VersionCmpKey, VersionCmpKey], bool]
|
|
|
53
53
|
|
|
54
54
|
# ../../omlish/lite/cached.py
|
|
55
55
|
T = ta.TypeVar('T')
|
|
56
|
+
CallableT = ta.TypeVar('CallableT', bound=ta.Callable)
|
|
56
57
|
|
|
57
58
|
# ../../omlish/lite/check.py
|
|
58
59
|
SizedT = ta.TypeVar('SizedT', bound=ta.Sized)
|
|
@@ -495,6 +496,12 @@ def cached_nullary(fn): # ta.Callable[..., T]) -> ta.Callable[..., T]:
|
|
|
495
496
|
return _cached_nullary(fn)
|
|
496
497
|
|
|
497
498
|
|
|
499
|
+
def static_init(fn: CallableT) -> CallableT:
|
|
500
|
+
fn = cached_nullary(fn)
|
|
501
|
+
fn()
|
|
502
|
+
return fn
|
|
503
|
+
|
|
504
|
+
|
|
498
505
|
########################################
|
|
499
506
|
# ../../../omlish/lite/check.py
|
|
500
507
|
|
|
@@ -91,6 +91,7 @@ TomlPos = int # ta.TypeAlias
|
|
|
91
91
|
|
|
92
92
|
# ../../omlish/lite/cached.py
|
|
93
93
|
T = ta.TypeVar('T')
|
|
94
|
+
CallableT = ta.TypeVar('CallableT', bound=ta.Callable)
|
|
94
95
|
|
|
95
96
|
# ../../omlish/lite/check.py
|
|
96
97
|
SizedT = ta.TypeVar('SizedT', bound=ta.Sized)
|
|
@@ -1785,6 +1786,12 @@ def cached_nullary(fn): # ta.Callable[..., T]) -> ta.Callable[..., T]:
|
|
|
1785
1786
|
return _cached_nullary(fn)
|
|
1786
1787
|
|
|
1787
1788
|
|
|
1789
|
+
def static_init(fn: CallableT) -> CallableT:
|
|
1790
|
+
fn = cached_nullary(fn)
|
|
1791
|
+
fn()
|
|
1792
|
+
return fn
|
|
1793
|
+
|
|
1794
|
+
|
|
1788
1795
|
########################################
|
|
1789
1796
|
# ../../../omlish/lite/check.py
|
|
1790
1797
|
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import dataclasses as dc
|
|
2
|
+
import os
|
|
3
|
+
import re
|
|
4
|
+
import typing as ta
|
|
5
|
+
|
|
6
|
+
from ..cli import CliModule
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
SUPPORTED_EXTENSIONS: ta.Mapping[str, str] = {
|
|
10
|
+
'.c': 'c',
|
|
11
|
+
'.cpp': 'c',
|
|
12
|
+
'.h': 'c',
|
|
13
|
+
'.hpp': 'c',
|
|
14
|
+
'.py': 'python',
|
|
15
|
+
'.js': 'javascript',
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
COMMENT_PATTERNS: ta.Mapping[str, tuple[str, str | None, str | None]] = {
|
|
20
|
+
'c': (r'//', r'/\*', r'\*/'),
|
|
21
|
+
'python': (r'#', None, None),
|
|
22
|
+
'javascript': (r'//', r'/\*', r'\*/'),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@dc.dataclass(frozen=True)
|
|
27
|
+
class FileLineCount:
|
|
28
|
+
loc: int
|
|
29
|
+
blanks: int
|
|
30
|
+
comments: int
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def count_lines(file_path: str, language: str) -> FileLineCount:
|
|
34
|
+
single_line_comment, block_comment_start, block_comment_end = COMMENT_PATTERNS[language]
|
|
35
|
+
|
|
36
|
+
in_block_comment = False
|
|
37
|
+
|
|
38
|
+
loc = 0
|
|
39
|
+
blank_lines = 0
|
|
40
|
+
comment_lines = 0
|
|
41
|
+
|
|
42
|
+
with open(file_path, encoding='utf-8') as file:
|
|
43
|
+
for line in file:
|
|
44
|
+
stripped = line.strip()
|
|
45
|
+
if not stripped:
|
|
46
|
+
blank_lines += 1
|
|
47
|
+
continue
|
|
48
|
+
|
|
49
|
+
if in_block_comment:
|
|
50
|
+
comment_lines += 1
|
|
51
|
+
if block_comment_end and re.search(block_comment_end, stripped):
|
|
52
|
+
in_block_comment = False
|
|
53
|
+
continue
|
|
54
|
+
|
|
55
|
+
if block_comment_start and re.search(block_comment_start, stripped):
|
|
56
|
+
comment_lines += 1
|
|
57
|
+
if block_comment_end and not re.search(block_comment_end, stripped):
|
|
58
|
+
in_block_comment = True
|
|
59
|
+
continue
|
|
60
|
+
|
|
61
|
+
if single_line_comment and stripped.startswith(single_line_comment):
|
|
62
|
+
comment_lines += 1
|
|
63
|
+
continue
|
|
64
|
+
|
|
65
|
+
loc += 1
|
|
66
|
+
|
|
67
|
+
return FileLineCount(
|
|
68
|
+
loc=loc,
|
|
69
|
+
blanks=blank_lines,
|
|
70
|
+
comments=comment_lines,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def count_lines_in_directory(directory: str) -> ta.Mapping[str, FileLineCount]:
|
|
75
|
+
results: dict[str, FileLineCount] = {}
|
|
76
|
+
for root, _, files in os.walk(directory):
|
|
77
|
+
for file in files:
|
|
78
|
+
ext = os.path.splitext(file)[1]
|
|
79
|
+
if ext in SUPPORTED_EXTENSIONS:
|
|
80
|
+
language = SUPPORTED_EXTENSIONS[ext]
|
|
81
|
+
file_path = os.path.join(root, file)
|
|
82
|
+
results[file_path] = count_lines(file_path, language)
|
|
83
|
+
return results
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
def display_results(results: ta.Mapping[str, FileLineCount]) -> None:
|
|
87
|
+
total_loc = total_blanks = total_comments = 0
|
|
88
|
+
file_width = max(map(len, results))
|
|
89
|
+
dash_width = 41 + file_width
|
|
90
|
+
|
|
91
|
+
print(
|
|
92
|
+
f"{'File'.ljust(file_width)} "
|
|
93
|
+
f"{'LOC':<10} "
|
|
94
|
+
f"{'Blank Lines':<15} "
|
|
95
|
+
f"{'Comment Lines':<15}",
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
print('-' * dash_width)
|
|
99
|
+
|
|
100
|
+
for file, counts in sorted(results.items()):
|
|
101
|
+
loc, blanks, comments = counts.loc, counts.blanks, counts.comments
|
|
102
|
+
total_loc += loc
|
|
103
|
+
total_blanks += blanks
|
|
104
|
+
total_comments += comments
|
|
105
|
+
print(
|
|
106
|
+
f'{file.ljust(file_width)} '
|
|
107
|
+
f'{loc:<10} '
|
|
108
|
+
f'{blanks:<15} '
|
|
109
|
+
f'{comments:<15}',
|
|
110
|
+
)
|
|
111
|
+
|
|
112
|
+
print('-' * dash_width)
|
|
113
|
+
|
|
114
|
+
print(
|
|
115
|
+
f"{' ' * file_width} "
|
|
116
|
+
f"{'LOC':<10} "
|
|
117
|
+
f"{'Blank Lines':<15} "
|
|
118
|
+
f"{'Comment Lines':<15}",
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
print('-' * dash_width)
|
|
122
|
+
|
|
123
|
+
print(
|
|
124
|
+
f"{'Total'.ljust(file_width)} "
|
|
125
|
+
f"{total_loc:<10} "
|
|
126
|
+
f"{total_blanks:<15} "
|
|
127
|
+
f"{total_comments:<15}",
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _main() -> None:
|
|
132
|
+
import argparse
|
|
133
|
+
|
|
134
|
+
parser = argparse.ArgumentParser(description='Count lines of code in source files.')
|
|
135
|
+
parser.add_argument('directory', help='The directory to analyze.', nargs='+')
|
|
136
|
+
args = parser.parse_args()
|
|
137
|
+
|
|
138
|
+
for directory in args.directory:
|
|
139
|
+
results = count_lines_in_directory(directory)
|
|
140
|
+
display_results(results)
|
|
141
|
+
print()
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# @omlish-manifest
|
|
145
|
+
_CLI_MODULE = CliModule('cloc', __name__)
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
if __name__ == '__main__':
|
|
149
|
+
_main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev141
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
|
12
12
|
Classifier: Operating System :: POSIX
|
|
13
13
|
Requires-Python: >=3.12
|
|
14
14
|
License-File: LICENSE
|
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
|
15
|
+
Requires-Dist: omlish==0.0.0.dev141
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: black~=24.10; extra == "all"
|
|
18
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
@@ -12,7 +12,7 @@ authors = [
|
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
|
14
14
|
requires-python = '>=3.12'
|
|
15
|
-
version = '0.0.0.
|
|
15
|
+
version = '0.0.0.dev141'
|
|
16
16
|
classifiers = [
|
|
17
17
|
'License :: OSI Approved :: BSD License',
|
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
description = 'omdev'
|
|
24
24
|
dependencies = [
|
|
25
|
-
'omlish == 0.0.0.
|
|
25
|
+
'omlish == 0.0.0.dev141',
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.optional-dependencies]
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|