From a2684dd601923ccda3b6b0d02ba6888c48ec3826 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 10 Jun 2026 07:22:46 +0200 Subject: [PATCH] jwutils: Move to jwutils -> jw.util Move all implementation source code from the jwutils module to jw.util. For compatibility with existing Python modules, keep a thin, autogenerated compatibility shim under jwutils. Signed-off-by: Jan Lindemann --- {tools => src}/Makefile | 0 {tools => src}/python/Makefile | 0 src/python/jw/Makefile | 4 ++ src/python/jw/__init__.py | 3 ++ .../python/jw/util}/ArgsContainer.py | 2 +- .../jwutils => src/python/jw/util}/Bunch.py | 0 .../jwutils => src/python/jw/util}/Cmd.py | 2 +- .../jwutils => src/python/jw/util}/Cmds.py | 5 +- .../jwutils => src/python/jw/util}/Config.py | 2 +- .../python/jw/util}/CppState.py | 0 src/python/jw/util/Makefile | 6 +++ .../jwutils => src/python/jw/util}/Object.py | 10 ++-- .../jwutils => src/python/jw/util}/Options.py | 0 .../jwutils => src/python/jw/util}/Process.py | 0 .../python/jw/util}/RedirectStdIO.py | 0 .../jwutils => src/python/jw/util}/Signals.py | 0 .../python/jw/util}/StopWatch.py | 0 src/python/jw/util/__init__.py | 3 ++ .../python/jw/util/algo}/Makefile | 0 .../python/jw/util}/algo/ShuntingYard.py | 0 .../python/jw/util/asyncio}/Makefile | 0 .../python/jw/util}/asyncio/Process.py | 0 .../python/jw/util}/asyncio/ShellCmd.py | 6 +-- .../python/jw/util}/asyncio/Signals.py | 0 .../python/jw/util}/auth/Auth.py | 5 +- .../python/jw/util/auth}/Makefile | 0 .../python/jw/util}/auth/dummy/Auth.py | 0 src/python/jw/util/auth/dummy/Makefile | 4 ++ .../python/jw/util}/auth/ldap/Auth.py | 0 src/python/jw/util/auth/ldap/Makefile | 4 ++ .../jwutils => src/python/jw/util}/cast.py | 0 .../python/jw/util}/db/DataBase.py | 6 +-- .../schema => src/python/jw/util/db}/Makefile | 0 .../python/jw/util}/db/Session.py | 0 .../python/jw/util}/db/TableIoHandler.py | 0 src/python/jw/util/db/query/Makefile | 4 ++ .../python/jw/util}/db/query/Queries.py | 14 ++--- .../python/jw/util}/db/query/Query.py | 14 ++--- .../python/jw/util}/db/query/QueryResult.py | 8 +-- .../jwutils => src/python/jw/util}/db/rows.py | 2 +- .../python/jw/util}/db/schema/Column.py | 0 .../python/jw/util}/db/schema/ColumnSet.py | 0 .../jw/util}/db/schema/CompositeForeignKey.py | 2 +- .../python/jw/util}/db/schema/DataType.py | 0 src/python/jw/util/db/schema/Makefile | 4 ++ .../python/jw/util}/db/schema/Schema.py | 0 .../jw/util}/db/schema/SingleForeignKey.py | 0 .../python/jw/util}/db/schema/Table.py | 0 .../python/jw/util}/db/schema/utils.py | 2 +- .../yed => src/python/jw/util/graph}/Makefile | 0 src/python/jw/util/graph/yed/Makefile | 4 ++ .../jw/util}/graph/yed/MapAttr2Shape.py | 2 +- .../jwutils => src/python/jw/util}/ldap.py | 0 .../jwutils => src/python/jw/util}/log.py | 0 .../jwutils => src/python/jw/util}/misc.py | 0 .../python/jw/util}/multi_key_dict.py | 0 src/python/jw/util/py.typed | 0 src/python/jw/util/stree/Makefile | 4 ++ .../python/jw/util}/stree/StringTree.py | 2 +- .../python/jw/util}/stree/serdes.py | 4 +- src/python/jwutils/ArgsContainer.py | 8 +++ src/python/jwutils/Bunch.py | 6 +++ src/python/jwutils/Cmd.py | 6 +++ src/python/jwutils/Cmds.py | 8 +++ src/python/jwutils/Config.py | 6 +++ src/python/jwutils/CppState.py | 6 +++ {tools => src}/python/jwutils/Makefile | 1 + src/python/jwutils/Object.py | 6 +++ src/python/jwutils/Options.py | 6 +++ src/python/jwutils/Process.py | 6 +++ src/python/jwutils/RedirectStdIO.py | 6 +++ src/python/jwutils/Signals.py | 3 ++ src/python/jwutils/StopWatch.py | 6 +++ src/python/jwutils/__init__.py | 51 +++++++++++++++++++ .../db => src/python/jwutils/algo}/Makefile | 1 + src/python/jwutils/algo/ShuntingYard.py | 12 +++++ src/python/jwutils/algo/__init__.py | 8 +++ .../python/jwutils/asyncio}/Makefile | 1 + src/python/jwutils/asyncio/Process.py | 6 +++ src/python/jwutils/asyncio/ShellCmd.py | 6 +++ src/python/jwutils/asyncio/Signals.py | 3 ++ src/python/jwutils/asyncio/__init__.py | 8 +++ src/python/jwutils/auth/Auth.py | 14 +++++ .../python/jwutils/auth}/Makefile | 1 + src/python/jwutils/auth/__init__.py | 11 ++++ src/python/jwutils/auth/dummy/Auth.py | 10 ++++ src/python/jwutils/auth/dummy/Makefile | 5 ++ src/python/jwutils/auth/dummy/__init__.py | 9 ++++ src/python/jwutils/auth/ldap/Auth.py | 8 +++ src/python/jwutils/auth/ldap/Makefile | 5 ++ src/python/jwutils/auth/ldap/__init__.py | 8 +++ src/python/jwutils/cast.py | 18 +++++++ src/python/jwutils/db/DataBase.py | 7 +++ .../auth => src/python/jwutils/db}/Makefile | 1 + src/python/jwutils/db/Session.py | 6 +++ src/python/jwutils/db/TableIoHandler.py | 6 +++ src/python/jwutils/db/__init__.py | 17 +++++++ src/python/jwutils/db/query/Makefile | 5 ++ src/python/jwutils/db/query/Queries.py | 6 +++ src/python/jwutils/db/query/Query.py | 6 +++ src/python/jwutils/db/query/QueryResult.py | 8 +++ src/python/jwutils/db/query/__init__.py | 10 ++++ src/python/jwutils/db/rows.py | 22 ++++++++ src/python/jwutils/db/schema/Column.py | 6 +++ src/python/jwutils/db/schema/ColumnSet.py | 6 +++ .../jwutils/db/schema/CompositeForeignKey.py | 6 +++ src/python/jwutils/db/schema/DataType.py | 10 ++++ src/python/jwutils/db/schema/Makefile | 5 ++ src/python/jwutils/db/schema/Schema.py | 6 +++ .../jwutils/db/schema/SingleForeignKey.py | 3 ++ src/python/jwutils/db/schema/Table.py | 6 +++ src/python/jwutils/db/schema/__init__.py | 14 +++++ src/python/jwutils/db/schema/utils.py | 6 +++ src/python/jwutils/graph/Makefile | 5 ++ src/python/jwutils/graph/__init__.py | 6 +++ src/python/jwutils/graph/yed/Makefile | 5 ++ src/python/jwutils/graph/yed/MapAttr2Shape.py | 6 +++ src/python/jwutils/graph/yed/__init__.py | 7 +++ src/python/jwutils/ldap.py | 8 +++ src/python/jwutils/log.py | 45 ++++++++++++++++ src/python/jwutils/misc.py | 28 ++++++++++ src/python/jwutils/multi_key_dict.py | 3 ++ src/python/jwutils/replace.sh | 32 ++++++++++++ src/python/jwutils/stree/Makefile | 5 ++ src/python/jwutils/stree/StringTree.py | 6 +++ src/python/jwutils/stree/__init__.py | 9 ++++ src/python/jwutils/stree/serdes.py | 8 +++ tools/python/jwutils/graph/Makefile | 4 -- tools/python/jwutils/stree/Makefile | 4 -- 129 files changed, 678 insertions(+), 52 deletions(-) rename {tools => src}/Makefile (100%) rename {tools => src}/python/Makefile (100%) create mode 100644 src/python/jw/Makefile create mode 100644 src/python/jw/__init__.py rename {tools/python/jwutils => src/python/jw/util}/ArgsContainer.py (98%) rename {tools/python/jwutils => src/python/jw/util}/Bunch.py (100%) rename {tools/python/jwutils => src/python/jw/util}/Cmd.py (98%) rename {tools/python/jwutils => src/python/jw/util}/Cmds.py (98%) rename {tools/python/jwutils => src/python/jw/util}/Config.py (99%) rename {tools/python/jwutils => src/python/jw/util}/CppState.py (100%) create mode 100644 src/python/jw/util/Makefile rename {tools/python/jwutils => src/python/jw/util}/Object.py (66%) rename {tools/python/jwutils => src/python/jw/util}/Options.py (100%) rename {tools/python/jwutils => src/python/jw/util}/Process.py (100%) rename {tools/python/jwutils => src/python/jw/util}/RedirectStdIO.py (100%) rename {tools/python/jwutils => src/python/jw/util}/Signals.py (100%) rename {tools/python/jwutils => src/python/jw/util}/StopWatch.py (100%) create mode 100644 src/python/jw/util/__init__.py rename {tools/python/jwutils/auth/dummy => src/python/jw/util/algo}/Makefile (100%) rename {tools/python/jwutils => src/python/jw/util}/algo/ShuntingYard.py (100%) rename {tools/python/jwutils/auth/ldap => src/python/jw/util/asyncio}/Makefile (100%) rename {tools/python/jwutils => src/python/jw/util}/asyncio/Process.py (100%) rename {tools/python/jwutils => src/python/jw/util}/asyncio/ShellCmd.py (97%) rename {tools/python/jwutils => src/python/jw/util}/asyncio/Signals.py (100%) rename {tools/python/jwutils => src/python/jw/util}/auth/Auth.py (97%) rename {tools/python/jwutils/db/query => src/python/jw/util/auth}/Makefile (100%) rename {tools/python/jwutils => src/python/jw/util}/auth/dummy/Auth.py (100%) create mode 100644 src/python/jw/util/auth/dummy/Makefile rename {tools/python/jwutils => src/python/jw/util}/auth/ldap/Auth.py (100%) create mode 100644 src/python/jw/util/auth/ldap/Makefile rename {tools/python/jwutils => src/python/jw/util}/cast.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/DataBase.py (88%) rename {tools/python/jwutils/db/schema => src/python/jw/util/db}/Makefile (100%) rename {tools/python/jwutils => src/python/jw/util}/db/Session.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/TableIoHandler.py (100%) create mode 100644 src/python/jw/util/db/query/Makefile rename {tools/python/jwutils => src/python/jw/util}/db/query/Queries.py (88%) rename {tools/python/jwutils => src/python/jw/util}/db/query/Query.py (82%) rename {tools/python/jwutils => src/python/jw/util}/db/query/QueryResult.py (90%) rename {tools/python/jwutils => src/python/jw/util}/db/rows.py (99%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/Column.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/ColumnSet.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/CompositeForeignKey.py (99%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/DataType.py (100%) create mode 100644 src/python/jw/util/db/schema/Makefile rename {tools/python/jwutils => src/python/jw/util}/db/schema/Schema.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/SingleForeignKey.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/Table.py (100%) rename {tools/python/jwutils => src/python/jw/util}/db/schema/utils.py (94%) rename {tools/python/jwutils/graph/yed => src/python/jw/util/graph}/Makefile (100%) create mode 100644 src/python/jw/util/graph/yed/Makefile rename {tools/python/jwutils => src/python/jw/util}/graph/yed/MapAttr2Shape.py (99%) rename {tools/python/jwutils => src/python/jw/util}/ldap.py (100%) rename {tools/python/jwutils => src/python/jw/util}/log.py (100%) rename {tools/python/jwutils => src/python/jw/util}/misc.py (100%) rename {tools/python/jwutils => src/python/jw/util}/multi_key_dict.py (100%) create mode 100644 src/python/jw/util/py.typed create mode 100644 src/python/jw/util/stree/Makefile rename {tools/python/jwutils => src/python/jw/util}/stree/StringTree.py (99%) rename {tools/python/jwutils => src/python/jw/util}/stree/serdes.py (98%) create mode 100644 src/python/jwutils/ArgsContainer.py create mode 100644 src/python/jwutils/Bunch.py create mode 100644 src/python/jwutils/Cmd.py create mode 100644 src/python/jwutils/Cmds.py create mode 100644 src/python/jwutils/Config.py create mode 100644 src/python/jwutils/CppState.py rename {tools => src}/python/jwutils/Makefile (76%) create mode 100644 src/python/jwutils/Object.py create mode 100644 src/python/jwutils/Options.py create mode 100644 src/python/jwutils/Process.py create mode 100644 src/python/jwutils/RedirectStdIO.py create mode 100644 src/python/jwutils/Signals.py create mode 100644 src/python/jwutils/StopWatch.py create mode 100644 src/python/jwutils/__init__.py rename {tools/python/jwutils/db => src/python/jwutils/algo}/Makefile (76%) create mode 100644 src/python/jwutils/algo/ShuntingYard.py create mode 100644 src/python/jwutils/algo/__init__.py rename {tools/python/jwutils/algo => src/python/jwutils/asyncio}/Makefile (76%) create mode 100644 src/python/jwutils/asyncio/Process.py create mode 100644 src/python/jwutils/asyncio/ShellCmd.py create mode 100644 src/python/jwutils/asyncio/Signals.py create mode 100644 src/python/jwutils/asyncio/__init__.py create mode 100644 src/python/jwutils/auth/Auth.py rename {tools/python/jwutils/asyncio => src/python/jwutils/auth}/Makefile (76%) create mode 100644 src/python/jwutils/auth/__init__.py create mode 100644 src/python/jwutils/auth/dummy/Auth.py create mode 100644 src/python/jwutils/auth/dummy/Makefile create mode 100644 src/python/jwutils/auth/dummy/__init__.py create mode 100644 src/python/jwutils/auth/ldap/Auth.py create mode 100644 src/python/jwutils/auth/ldap/Makefile create mode 100644 src/python/jwutils/auth/ldap/__init__.py create mode 100644 src/python/jwutils/cast.py create mode 100644 src/python/jwutils/db/DataBase.py rename {tools/python/jwutils/auth => src/python/jwutils/db}/Makefile (76%) create mode 100644 src/python/jwutils/db/Session.py create mode 100644 src/python/jwutils/db/TableIoHandler.py create mode 100644 src/python/jwutils/db/__init__.py create mode 100644 src/python/jwutils/db/query/Makefile create mode 100644 src/python/jwutils/db/query/Queries.py create mode 100644 src/python/jwutils/db/query/Query.py create mode 100644 src/python/jwutils/db/query/QueryResult.py create mode 100644 src/python/jwutils/db/query/__init__.py create mode 100644 src/python/jwutils/db/rows.py create mode 100644 src/python/jwutils/db/schema/Column.py create mode 100644 src/python/jwutils/db/schema/ColumnSet.py create mode 100644 src/python/jwutils/db/schema/CompositeForeignKey.py create mode 100644 src/python/jwutils/db/schema/DataType.py create mode 100644 src/python/jwutils/db/schema/Makefile create mode 100644 src/python/jwutils/db/schema/Schema.py create mode 100644 src/python/jwutils/db/schema/SingleForeignKey.py create mode 100644 src/python/jwutils/db/schema/Table.py create mode 100644 src/python/jwutils/db/schema/__init__.py create mode 100644 src/python/jwutils/db/schema/utils.py create mode 100644 src/python/jwutils/graph/Makefile create mode 100644 src/python/jwutils/graph/__init__.py create mode 100644 src/python/jwutils/graph/yed/Makefile create mode 100644 src/python/jwutils/graph/yed/MapAttr2Shape.py create mode 100644 src/python/jwutils/graph/yed/__init__.py create mode 100644 src/python/jwutils/ldap.py create mode 100644 src/python/jwutils/log.py create mode 100644 src/python/jwutils/misc.py create mode 100644 src/python/jwutils/multi_key_dict.py create mode 100644 src/python/jwutils/replace.sh create mode 100644 src/python/jwutils/stree/Makefile create mode 100644 src/python/jwutils/stree/StringTree.py create mode 100644 src/python/jwutils/stree/__init__.py create mode 100644 src/python/jwutils/stree/serdes.py delete mode 100644 tools/python/jwutils/graph/Makefile delete mode 100644 tools/python/jwutils/stree/Makefile diff --git a/tools/Makefile b/src/Makefile similarity index 100% rename from tools/Makefile rename to src/Makefile diff --git a/tools/python/Makefile b/src/python/Makefile similarity index 100% rename from tools/python/Makefile rename to src/python/Makefile diff --git a/src/python/jw/Makefile b/src/python/jw/Makefile new file mode 100644 index 0000000..d99ad1c --- /dev/null +++ b/src/python/jw/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-ns-dir.mk diff --git a/src/python/jw/__init__.py b/src/python/jw/__init__.py new file mode 100644 index 0000000..b36383a --- /dev/null +++ b/src/python/jw/__init__.py @@ -0,0 +1,3 @@ +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) diff --git a/tools/python/jwutils/ArgsContainer.py b/src/python/jw/util/ArgsContainer.py similarity index 98% rename from tools/python/jwutils/ArgsContainer.py rename to src/python/jw/util/ArgsContainer.py index 7db211f..fdc02af 100644 --- a/tools/python/jwutils/ArgsContainer.py +++ b/src/python/jw/util/ArgsContainer.py @@ -4,7 +4,7 @@ import argparse from collections import OrderedDict -from jwutils.log import * +from .log import slog class ArgsContainer: # export diff --git a/tools/python/jwutils/Bunch.py b/src/python/jw/util/Bunch.py similarity index 100% rename from tools/python/jwutils/Bunch.py rename to src/python/jw/util/Bunch.py diff --git a/tools/python/jwutils/Cmd.py b/src/python/jw/util/Cmd.py similarity index 98% rename from tools/python/jwutils/Cmd.py rename to src/python/jw/util/Cmd.py index 8ca5be4..0903a7b 100644 --- a/tools/python/jwutils/Cmd.py +++ b/src/python/jw/util/Cmd.py @@ -4,7 +4,7 @@ from __future__ import annotations import inspect, sys, re, abc, argparse from argparse import ArgumentParser, _SubParsersAction -from jwutils import log +from . import log # full blown example of one level of nested subcommands # git -C project remote -v show -n myremote diff --git a/tools/python/jwutils/Cmds.py b/src/python/jw/util/Cmds.py similarity index 98% rename from tools/python/jwutils/Cmds.py rename to src/python/jw/util/Cmds.py index a784776..13f07fa 100644 --- a/tools/python/jwutils/Cmds.py +++ b/src/python/jw/util/Cmds.py @@ -4,9 +4,8 @@ import os, sys, argcomplete, argparse, importlib, inspect, re, pickle, asyncio, from argparse import ArgumentParser from pathlib import Path, PurePath -import jwutils -from jwutils.log import * -from jwutils.stree import serdes +from .log import * +from .stree import serdes class Cmds: # export diff --git a/tools/python/jwutils/Config.py b/src/python/jw/util/Config.py similarity index 99% rename from tools/python/jwutils/Config.py rename to src/python/jw/util/Config.py index e55296a..b4eed8f 100644 --- a/tools/python/jwutils/Config.py +++ b/src/python/jw/util/Config.py @@ -4,7 +4,7 @@ from typing import Optional, Dict, cast import os, re, glob, sys from pathlib import Path, PosixPath -from jwutils import stree +from . import stree from .stree.StringTree import StringTree from .log import * diff --git a/tools/python/jwutils/CppState.py b/src/python/jw/util/CppState.py similarity index 100% rename from tools/python/jwutils/CppState.py rename to src/python/jw/util/CppState.py diff --git a/src/python/jw/util/Makefile b/src/python/jw/util/Makefile new file mode 100644 index 0000000..8785ac2 --- /dev/null +++ b/src/python/jw/util/Makefile @@ -0,0 +1,6 @@ +TOPDIR = ../../../.. + +PY_UPDATE_INIT_PY ?= false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/Object.py b/src/python/jw/util/Object.py similarity index 66% rename from tools/python/jwutils/Object.py rename to src/python/jw/util/Object.py index f5ea5ab..0e7ddc6 100644 --- a/tools/python/jwutils/Object.py +++ b/src/python/jw/util/Object.py @@ -2,16 +2,16 @@ from __future__ import print_function -import jwutils.log +from . import log class Object(object): # export def __init__(self): - self.log_level = jwutils.log.level + self.log_level = log.level def log(self, prio, *args): - if self.log_level == jwutils.log.level: - jwutils.log.slog(prio, args) + if self.log_level == log.level: + log.slog(prio, args) return if prio <= self.log_level: msg = "" @@ -21,4 +21,4 @@ class Object(object): # export print(msg[1:]) def debug(self, *args): - jwutils.log.slog(jwutils.log.DEBUG, args) + log.slog(log.DEBUG, args) diff --git a/tools/python/jwutils/Options.py b/src/python/jw/util/Options.py similarity index 100% rename from tools/python/jwutils/Options.py rename to src/python/jw/util/Options.py diff --git a/tools/python/jwutils/Process.py b/src/python/jw/util/Process.py similarity index 100% rename from tools/python/jwutils/Process.py rename to src/python/jw/util/Process.py diff --git a/tools/python/jwutils/RedirectStdIO.py b/src/python/jw/util/RedirectStdIO.py similarity index 100% rename from tools/python/jwutils/RedirectStdIO.py rename to src/python/jw/util/RedirectStdIO.py diff --git a/tools/python/jwutils/Signals.py b/src/python/jw/util/Signals.py similarity index 100% rename from tools/python/jwutils/Signals.py rename to src/python/jw/util/Signals.py diff --git a/tools/python/jwutils/StopWatch.py b/src/python/jw/util/StopWatch.py similarity index 100% rename from tools/python/jwutils/StopWatch.py rename to src/python/jw/util/StopWatch.py diff --git a/src/python/jw/util/__init__.py b/src/python/jw/util/__init__.py new file mode 100644 index 0000000..b36383a --- /dev/null +++ b/src/python/jw/util/__init__.py @@ -0,0 +1,3 @@ +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) diff --git a/tools/python/jwutils/auth/dummy/Makefile b/src/python/jw/util/algo/Makefile similarity index 100% rename from tools/python/jwutils/auth/dummy/Makefile rename to src/python/jw/util/algo/Makefile diff --git a/tools/python/jwutils/algo/ShuntingYard.py b/src/python/jw/util/algo/ShuntingYard.py similarity index 100% rename from tools/python/jwutils/algo/ShuntingYard.py rename to src/python/jw/util/algo/ShuntingYard.py diff --git a/tools/python/jwutils/auth/ldap/Makefile b/src/python/jw/util/asyncio/Makefile similarity index 100% rename from tools/python/jwutils/auth/ldap/Makefile rename to src/python/jw/util/asyncio/Makefile diff --git a/tools/python/jwutils/asyncio/Process.py b/src/python/jw/util/asyncio/Process.py similarity index 100% rename from tools/python/jwutils/asyncio/Process.py rename to src/python/jw/util/asyncio/Process.py diff --git a/tools/python/jwutils/asyncio/ShellCmd.py b/src/python/jw/util/asyncio/ShellCmd.py similarity index 97% rename from tools/python/jwutils/asyncio/ShellCmd.py rename to src/python/jw/util/asyncio/ShellCmd.py index a7eaba1..ab62610 100644 --- a/tools/python/jwutils/asyncio/ShellCmd.py +++ b/src/python/jw/util/asyncio/ShellCmd.py @@ -1,5 +1,5 @@ import asyncio -from jwutils.log import * +from ..log import * # FIXME: Derive this from Process, or merge the classes entirely @@ -98,8 +98,8 @@ class ShellCmd: # export await self.cleanup() if __name__ == '__main__': - import jwutils.log - jwutils.log.set_level('info') + from .. import log + log.set_level('info') async def run(): sp = ShellCmd([ 'echo', 'hello world!' ]) await sp.run() diff --git a/tools/python/jwutils/asyncio/Signals.py b/src/python/jw/util/asyncio/Signals.py similarity index 100% rename from tools/python/jwutils/asyncio/Signals.py rename to src/python/jw/util/asyncio/Signals.py diff --git a/tools/python/jwutils/auth/Auth.py b/src/python/jw/util/auth/Auth.py similarity index 97% rename from tools/python/jwutils/auth/Auth.py rename to src/python/jw/util/auth/Auth.py index 714fd92..0f56fcc 100644 --- a/tools/python/jwutils/auth/Auth.py +++ b/src/python/jw/util/auth/Auth.py @@ -6,8 +6,9 @@ import abc from enum import Flag, Enum, auto -from jwutils.log import * -from jwutils import Config, load_object +from ..log import * +from ..Config import Config +from ..misc import load_object class Access(Enum): # export Read = auto() diff --git a/tools/python/jwutils/db/query/Makefile b/src/python/jw/util/auth/Makefile similarity index 100% rename from tools/python/jwutils/db/query/Makefile rename to src/python/jw/util/auth/Makefile diff --git a/tools/python/jwutils/auth/dummy/Auth.py b/src/python/jw/util/auth/dummy/Auth.py similarity index 100% rename from tools/python/jwutils/auth/dummy/Auth.py rename to src/python/jw/util/auth/dummy/Auth.py diff --git a/src/python/jw/util/auth/dummy/Makefile b/src/python/jw/util/auth/dummy/Makefile new file mode 100644 index 0000000..7a83c33 --- /dev/null +++ b/src/python/jw/util/auth/dummy/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/auth/ldap/Auth.py b/src/python/jw/util/auth/ldap/Auth.py similarity index 100% rename from tools/python/jwutils/auth/ldap/Auth.py rename to src/python/jw/util/auth/ldap/Auth.py diff --git a/src/python/jw/util/auth/ldap/Makefile b/src/python/jw/util/auth/ldap/Makefile new file mode 100644 index 0000000..7a83c33 --- /dev/null +++ b/src/python/jw/util/auth/ldap/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/cast.py b/src/python/jw/util/cast.py similarity index 100% rename from tools/python/jwutils/cast.py rename to src/python/jw/util/cast.py diff --git a/tools/python/jwutils/db/DataBase.py b/src/python/jw/util/db/DataBase.py similarity index 88% rename from tools/python/jwutils/db/DataBase.py rename to src/python/jw/util/db/DataBase.py index ffd9f9e..25812dd 100644 --- a/tools/python/jwutils/db/DataBase.py +++ b/src/python/jw/util/db/DataBase.py @@ -5,9 +5,9 @@ from typing import Any import abc from contextlib import contextmanager -from jwutils.Config import Config -from jwutils.db.schema.Schema import Schema -from jwutils import Cmds +from ..Config import Config +from .schema.Schema import Schema +from ..Cmds import Cmds from .Session import Session from ..log import * diff --git a/tools/python/jwutils/db/schema/Makefile b/src/python/jw/util/db/Makefile similarity index 100% rename from tools/python/jwutils/db/schema/Makefile rename to src/python/jw/util/db/Makefile diff --git a/tools/python/jwutils/db/Session.py b/src/python/jw/util/db/Session.py similarity index 100% rename from tools/python/jwutils/db/Session.py rename to src/python/jw/util/db/Session.py diff --git a/tools/python/jwutils/db/TableIoHandler.py b/src/python/jw/util/db/TableIoHandler.py similarity index 100% rename from tools/python/jwutils/db/TableIoHandler.py rename to src/python/jw/util/db/TableIoHandler.py diff --git a/src/python/jw/util/db/query/Makefile b/src/python/jw/util/db/query/Makefile new file mode 100644 index 0000000..7a83c33 --- /dev/null +++ b/src/python/jw/util/db/query/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/db/query/Queries.py b/src/python/jw/util/db/query/Queries.py similarity index 88% rename from tools/python/jwutils/db/query/Queries.py rename to src/python/jw/util/db/query/Queries.py index 191f333..ecff98d 100644 --- a/tools/python/jwutils/db/query/Queries.py +++ b/src/python/jw/util/db/query/Queries.py @@ -4,13 +4,13 @@ from typing import Any import abc -from jwutils.log import * -from jwutils.misc import load_classes -from jwutils.Cmds import Cmds -from jwutils.db.DataBase import DataBase -from jwutils.db.query.Query import Query as QueryBase -from jwutils.db.query.QueryResult import QueryResult -from jwutils.db.schema.Schema import Schema +from ...log import * +from ...misc import load_classes +from ...Cmds import Cmds +from ..DataBase import DataBase +from ..schema.Schema import Schema +from .Query import Query as QueryBase +from .QueryResult import QueryResult class Queries(abc.ABC): # export diff --git a/tools/python/jwutils/db/query/Query.py b/src/python/jw/util/db/query/Query.py similarity index 82% rename from tools/python/jwutils/db/query/Query.py rename to src/python/jw/util/db/query/Query.py index 5e9e10a..5773df7 100644 --- a/tools/python/jwutils/db/query/Query.py +++ b/src/python/jw/util/db/query/Query.py @@ -4,13 +4,13 @@ from typing import Any import abc -from jwutils.log import * -from jwutils.misc import load_classes -from jwutils.Cmds import Cmds -from jwutils.db.DataBase import DataBase -from jwutils.db.Session import Session -from jwutils.db.query.QueryResult import QueryResult -#from jwutils.db.query.Queries import Queries +from ...log import * +from ...misc import load_classes +from ...Cmds import Cmds +from ..DataBase import DataBase +from ..Session import Session +from .QueryResult import QueryResult +#from .Queries import Queries class Query(abc.ABC): # export diff --git a/tools/python/jwutils/db/query/QueryResult.py b/src/python/jw/util/db/query/QueryResult.py similarity index 90% rename from tools/python/jwutils/db/query/QueryResult.py rename to src/python/jw/util/db/query/QueryResult.py index baa2ca1..eb3663e 100644 --- a/tools/python/jwutils/db/query/QueryResult.py +++ b/src/python/jw/util/db/query/QueryResult.py @@ -5,10 +5,10 @@ from typing import Any, Union import abc from enum import Enum, auto -from jwutils.log import * -from jwutils.Cmds import Cmds -from jwutils.db.DataBase import DataBase -from jwutils.db.Session import Session +from ...log import * +from ...Cmds import Cmds +from ..DataBase import DataBase +from ..Session import Session class ResType(Enum): # export Statement = auto() diff --git a/tools/python/jwutils/db/rows.py b/src/python/jw/util/db/rows.py similarity index 99% rename from tools/python/jwutils/db/rows.py rename to src/python/jw/util/db/rows.py index 682c2a4..0eea9b6 100644 --- a/tools/python/jwutils/db/rows.py +++ b/src/python/jw/util/db/rows.py @@ -3,7 +3,7 @@ import io, os, re, textwrap, json, csv from tabulate import tabulate # type: ignore -from jwutils.log import * +from ..log import * def rows_pretty(rows): # export if type(rows) == dict: diff --git a/tools/python/jwutils/db/schema/Column.py b/src/python/jw/util/db/schema/Column.py similarity index 100% rename from tools/python/jwutils/db/schema/Column.py rename to src/python/jw/util/db/schema/Column.py diff --git a/tools/python/jwutils/db/schema/ColumnSet.py b/src/python/jw/util/db/schema/ColumnSet.py similarity index 100% rename from tools/python/jwutils/db/schema/ColumnSet.py rename to src/python/jw/util/db/schema/ColumnSet.py diff --git a/tools/python/jwutils/db/schema/CompositeForeignKey.py b/src/python/jw/util/db/schema/CompositeForeignKey.py similarity index 99% rename from tools/python/jwutils/db/schema/CompositeForeignKey.py rename to src/python/jw/util/db/schema/CompositeForeignKey.py index f9f059b..5a4062b 100644 --- a/tools/python/jwutils/db/schema/CompositeForeignKey.py +++ b/src/python/jw/util/db/schema/CompositeForeignKey.py @@ -2,7 +2,7 @@ from typing import Optional, Any -from jwutils.log import * +from ...log import * from .ColumnSet import ColumnSet from .SingleForeignKey import SingleForeignKey diff --git a/tools/python/jwutils/db/schema/DataType.py b/src/python/jw/util/db/schema/DataType.py similarity index 100% rename from tools/python/jwutils/db/schema/DataType.py rename to src/python/jw/util/db/schema/DataType.py diff --git a/src/python/jw/util/db/schema/Makefile b/src/python/jw/util/db/schema/Makefile new file mode 100644 index 0000000..7a83c33 --- /dev/null +++ b/src/python/jw/util/db/schema/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/db/schema/Schema.py b/src/python/jw/util/db/schema/Schema.py similarity index 100% rename from tools/python/jwutils/db/schema/Schema.py rename to src/python/jw/util/db/schema/Schema.py diff --git a/tools/python/jwutils/db/schema/SingleForeignKey.py b/src/python/jw/util/db/schema/SingleForeignKey.py similarity index 100% rename from tools/python/jwutils/db/schema/SingleForeignKey.py rename to src/python/jw/util/db/schema/SingleForeignKey.py diff --git a/tools/python/jwutils/db/schema/Table.py b/src/python/jw/util/db/schema/Table.py similarity index 100% rename from tools/python/jwutils/db/schema/Table.py rename to src/python/jw/util/db/schema/Table.py diff --git a/tools/python/jwutils/db/schema/utils.py b/src/python/jw/util/db/schema/utils.py similarity index 94% rename from tools/python/jwutils/db/schema/utils.py rename to src/python/jw/util/db/schema/utils.py index 65b3e89..f2226c6 100644 --- a/tools/python/jwutils/db/schema/utils.py +++ b/src/python/jw/util/db/schema/utils.py @@ -2,7 +2,7 @@ from .Schema import Schema -from jwutils.log import * +from ...log import * def check_schema(schema: Schema): # export slog(NOTICE, f'There are {len(schema)} tables in the database') diff --git a/tools/python/jwutils/graph/yed/Makefile b/src/python/jw/util/graph/Makefile similarity index 100% rename from tools/python/jwutils/graph/yed/Makefile rename to src/python/jw/util/graph/Makefile diff --git a/src/python/jw/util/graph/yed/Makefile b/src/python/jw/util/graph/yed/Makefile new file mode 100644 index 0000000..7a83c33 --- /dev/null +++ b/src/python/jw/util/graph/yed/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/graph/yed/MapAttr2Shape.py b/src/python/jw/util/graph/yed/MapAttr2Shape.py similarity index 99% rename from tools/python/jwutils/graph/yed/MapAttr2Shape.py rename to src/python/jw/util/graph/yed/MapAttr2Shape.py index 9749bdf..eaf2b13 100644 --- a/tools/python/jwutils/graph/yed/MapAttr2Shape.py +++ b/src/python/jw/util/graph/yed/MapAttr2Shape.py @@ -4,7 +4,7 @@ from collections.abc import Callable import xml.etree.ElementTree as ET -from jwutils.log import * +from ...log import * class MapAttr2Shape: # export diff --git a/tools/python/jwutils/ldap.py b/src/python/jw/util/ldap.py similarity index 100% rename from tools/python/jwutils/ldap.py rename to src/python/jw/util/ldap.py diff --git a/tools/python/jwutils/log.py b/src/python/jw/util/log.py similarity index 100% rename from tools/python/jwutils/log.py rename to src/python/jw/util/log.py diff --git a/tools/python/jwutils/misc.py b/src/python/jw/util/misc.py similarity index 100% rename from tools/python/jwutils/misc.py rename to src/python/jw/util/misc.py diff --git a/tools/python/jwutils/multi_key_dict.py b/src/python/jw/util/multi_key_dict.py similarity index 100% rename from tools/python/jwutils/multi_key_dict.py rename to src/python/jw/util/multi_key_dict.py diff --git a/src/python/jw/util/py.typed b/src/python/jw/util/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/src/python/jw/util/stree/Makefile b/src/python/jw/util/stree/Makefile new file mode 100644 index 0000000..781b0c8 --- /dev/null +++ b/src/python/jw/util/stree/Makefile @@ -0,0 +1,4 @@ +TOPDIR = ../../../../.. + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/stree/StringTree.py b/src/python/jw/util/stree/StringTree.py similarity index 99% rename from tools/python/jwutils/stree/StringTree.py rename to src/python/jw/util/stree/StringTree.py index de986a2..8bc4d89 100644 --- a/tools/python/jwutils/stree/StringTree.py +++ b/src/python/jw/util/stree/StringTree.py @@ -8,7 +8,7 @@ import re, fnmatch from collections import OrderedDict from enum import Enum, auto -from jwutils.log import * +from ..log import * def quote(s): if is_quoted(s): diff --git a/tools/python/jwutils/stree/serdes.py b/src/python/jw/util/stree/serdes.py similarity index 98% rename from tools/python/jwutils/stree/serdes.py rename to src/python/jw/util/stree/serdes.py index 1249f86..9c8621c 100644 --- a/tools/python/jwutils/stree/serdes.py +++ b/src/python/jw/util/stree/serdes.py @@ -2,8 +2,8 @@ import os, glob -from jwutils.stree.StringTree import * -from jwutils.log import * +from .StringTree import * +from ..log import * def _cleanup_line(line: str) -> str: line = line.strip() diff --git a/src/python/jwutils/ArgsContainer.py b/src/python/jwutils/ArgsContainer.py new file mode 100644 index 0000000..14a6541 --- /dev/null +++ b/src/python/jwutils/ArgsContainer.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.ArgsContainer import ArgsContainer as ArgsContainer +from jw.util.ArgsContainer import add_argument as add_argument + +__all__ = [ + "ArgsContainer", + "add_argument", +] diff --git a/src/python/jwutils/Bunch.py b/src/python/jwutils/Bunch.py new file mode 100644 index 0000000..c7d9fc9 --- /dev/null +++ b/src/python/jwutils/Bunch.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Bunch import Bunch as Bunch + +__all__ = [ + "Bunch", +] diff --git a/src/python/jwutils/Cmd.py b/src/python/jwutils/Cmd.py new file mode 100644 index 0000000..a632ed6 --- /dev/null +++ b/src/python/jwutils/Cmd.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Cmd import Cmd as Cmd + +__all__ = [ + "Cmd", +] diff --git a/src/python/jwutils/Cmds.py b/src/python/jwutils/Cmds.py new file mode 100644 index 0000000..7a5cae2 --- /dev/null +++ b/src/python/jwutils/Cmds.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.Cmds import Cmds as Cmds +from jw.util.Cmds import run_sub_commands as run_sub_commands + +__all__ = [ + "Cmds", + "run_sub_commands", +] diff --git a/src/python/jwutils/Config.py b/src/python/jwutils/Config.py new file mode 100644 index 0000000..cd84017 --- /dev/null +++ b/src/python/jwutils/Config.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Config import Config as Config + +__all__ = [ + "Config", +] diff --git a/src/python/jwutils/CppState.py b/src/python/jwutils/CppState.py new file mode 100644 index 0000000..da9fd57 --- /dev/null +++ b/src/python/jwutils/CppState.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.CppState import CppState as CppState + +__all__ = [ + "CppState", +] diff --git a/tools/python/jwutils/Makefile b/src/python/jwutils/Makefile similarity index 76% rename from tools/python/jwutils/Makefile rename to src/python/jwutils/Makefile index c3ddd38..0c70fd8 100644 --- a/tools/python/jwutils/Makefile +++ b/src/python/jwutils/Makefile @@ -1,4 +1,5 @@ TOPDIR = ../../.. +PY_UPDATE_INIT_PY = false include $(TOPDIR)/make/proj.mk include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/Object.py b/src/python/jwutils/Object.py new file mode 100644 index 0000000..d1867ae --- /dev/null +++ b/src/python/jwutils/Object.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Object import Object as Object + +__all__ = [ + "Object", +] diff --git a/src/python/jwutils/Options.py b/src/python/jwutils/Options.py new file mode 100644 index 0000000..b5a5032 --- /dev/null +++ b/src/python/jwutils/Options.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Options import Options as Options + +__all__ = [ + "Options", +] diff --git a/src/python/jwutils/Process.py b/src/python/jwutils/Process.py new file mode 100644 index 0000000..5b79021 --- /dev/null +++ b/src/python/jwutils/Process.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.Process import Process as Process + +__all__ = [ + "Process", +] diff --git a/src/python/jwutils/RedirectStdIO.py b/src/python/jwutils/RedirectStdIO.py new file mode 100644 index 0000000..3d7e7ca --- /dev/null +++ b/src/python/jwutils/RedirectStdIO.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.RedirectStdIO import RedirectStdIO as RedirectStdIO + +__all__ = [ + "RedirectStdIO", +] diff --git a/src/python/jwutils/Signals.py b/src/python/jwutils/Signals.py new file mode 100644 index 0000000..cdee73d --- /dev/null +++ b/src/python/jwutils/Signals.py @@ -0,0 +1,3 @@ +# ruff: noqa: E501 + +__all__ = [] diff --git a/src/python/jwutils/StopWatch.py b/src/python/jwutils/StopWatch.py new file mode 100644 index 0000000..c3c591d --- /dev/null +++ b/src/python/jwutils/StopWatch.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.StopWatch import StopWatch as StopWatch + +__all__ = [ + "StopWatch", +] diff --git a/src/python/jwutils/__init__.py b/src/python/jwutils/__init__.py new file mode 100644 index 0000000..a1529c9 --- /dev/null +++ b/src/python/jwutils/__init__.py @@ -0,0 +1,51 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .ArgsContainer import ArgsContainer as ArgsContainer +from .ArgsContainer import add_argument as add_argument +from .Bunch import Bunch as Bunch +from .cast import cast_str_to_timedelta as cast_str_to_timedelta +from .cast import cast_str_to_int as cast_str_to_int +from .cast import cast_str_to_bool as cast_str_to_bool +from .cast import guess_type as guess_type +from .cast import from_str as from_str +from .cast import from_env as from_env +from .Cmds import Cmds as Cmds +from .Cmds import run_sub_commands as run_sub_commands +from .Config import Config as Config +from .CppState import CppState as CppState +from .ldap import Connection as Connection +from .ldap import default_config as default_config +from .log import prio_gets_logged as prio_gets_logged +from .log import log_level as log_level +from .log import slog_m as slog_m +from .log import slog as slog +from .log import parse_log_prio_str as parse_log_prio_str +from .log import console_color_chars as console_color_chars +from .log import set_level as set_level +from .log import set_flags as set_flags +from .log import append_to_prefix as append_to_prefix +from .log import remove_from_prefix as remove_from_prefix +from .log import set_filename_length as set_filename_length +from .log import set_module_name_length as set_module_name_length +from .log import add_log_file as add_log_file +from .misc import silentremove as silentremove +from .misc import atomic_store as atomic_store +from .misc import object_builtin_name as object_builtin_name +from .misc import get_derived_classes as get_derived_classes +from .misc import load_classes as load_classes +from .misc import load_class as load_class +from .misc import load_class_names as load_class_names +from .misc import load_object as load_object +from .misc import load_function as load_function +from .misc import commit_tmpfile as commit_tmpfile +from .misc import multi_regex_edit as multi_regex_edit +from .misc import dump as dump +from .Object import Object as Object +from .Options import Options as Options +from .Process import Process as Process +from .RedirectStdIO import RedirectStdIO as RedirectStdIO +from .StopWatch import StopWatch as StopWatch +# << -------------------------- generated by python-tools.sh << diff --git a/tools/python/jwutils/db/Makefile b/src/python/jwutils/algo/Makefile similarity index 76% rename from tools/python/jwutils/db/Makefile rename to src/python/jwutils/algo/Makefile index 59b3ac1..b54ec56 100644 --- a/tools/python/jwutils/db/Makefile +++ b/src/python/jwutils/algo/Makefile @@ -1,4 +1,5 @@ TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false include $(TOPDIR)/make/proj.mk include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/algo/ShuntingYard.py b/src/python/jwutils/algo/ShuntingYard.py new file mode 100644 index 0000000..b0563f8 --- /dev/null +++ b/src/python/jwutils/algo/ShuntingYard.py @@ -0,0 +1,12 @@ +# ruff: noqa: E501 +from jw.util.algo.ShuntingYard import L as L +from jw.util.algo.ShuntingYard import R as R +from jw.util.algo.ShuntingYard import Operator as Operator +from jw.util.algo.ShuntingYard import ShuntingYard as ShuntingYard + +__all__ = [ + "L", + "R", + "Operator", + "ShuntingYard", +] diff --git a/src/python/jwutils/algo/__init__.py b/src/python/jwutils/algo/__init__.py new file mode 100644 index 0000000..f6d86d6 --- /dev/null +++ b/src/python/jwutils/algo/__init__.py @@ -0,0 +1,8 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .ShuntingYard import Operator as Operator +from .ShuntingYard import ShuntingYard as ShuntingYard +# << -------------------------- generated by python-tools.sh << diff --git a/tools/python/jwutils/algo/Makefile b/src/python/jwutils/asyncio/Makefile similarity index 76% rename from tools/python/jwutils/algo/Makefile rename to src/python/jwutils/asyncio/Makefile index 59b3ac1..b54ec56 100644 --- a/tools/python/jwutils/algo/Makefile +++ b/src/python/jwutils/asyncio/Makefile @@ -1,4 +1,5 @@ TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false include $(TOPDIR)/make/proj.mk include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/asyncio/Process.py b/src/python/jwutils/asyncio/Process.py new file mode 100644 index 0000000..c26cefd --- /dev/null +++ b/src/python/jwutils/asyncio/Process.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.asyncio.Process import Process as Process + +__all__ = [ + "Process", +] diff --git a/src/python/jwutils/asyncio/ShellCmd.py b/src/python/jwutils/asyncio/ShellCmd.py new file mode 100644 index 0000000..525cf31 --- /dev/null +++ b/src/python/jwutils/asyncio/ShellCmd.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.asyncio.ShellCmd import ShellCmd as ShellCmd + +__all__ = [ + "ShellCmd", +] diff --git a/src/python/jwutils/asyncio/Signals.py b/src/python/jwutils/asyncio/Signals.py new file mode 100644 index 0000000..cdee73d --- /dev/null +++ b/src/python/jwutils/asyncio/Signals.py @@ -0,0 +1,3 @@ +# ruff: noqa: E501 + +__all__ = [] diff --git a/src/python/jwutils/asyncio/__init__.py b/src/python/jwutils/asyncio/__init__.py new file mode 100644 index 0000000..d0c6125 --- /dev/null +++ b/src/python/jwutils/asyncio/__init__.py @@ -0,0 +1,8 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Process import Process as Process +from .ShellCmd import ShellCmd as ShellCmd +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/auth/Auth.py b/src/python/jwutils/auth/Auth.py new file mode 100644 index 0000000..17bff77 --- /dev/null +++ b/src/python/jwutils/auth/Auth.py @@ -0,0 +1,14 @@ +# ruff: noqa: E501 +from jw.util.auth.Auth import Access as Access +from jw.util.auth.Auth import ProjectFlags as ProjectFlags +from jw.util.auth.Auth import Group as Group +from jw.util.auth.Auth import User as User +from jw.util.auth.Auth import Auth as Auth + +__all__ = [ + "Access", + "ProjectFlags", + "Group", + "User", + "Auth", +] diff --git a/tools/python/jwutils/asyncio/Makefile b/src/python/jwutils/auth/Makefile similarity index 76% rename from tools/python/jwutils/asyncio/Makefile rename to src/python/jwutils/auth/Makefile index 59b3ac1..b54ec56 100644 --- a/tools/python/jwutils/asyncio/Makefile +++ b/src/python/jwutils/auth/Makefile @@ -1,4 +1,5 @@ TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false include $(TOPDIR)/make/proj.mk include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/auth/__init__.py b/src/python/jwutils/auth/__init__.py new file mode 100644 index 0000000..d6b3a23 --- /dev/null +++ b/src/python/jwutils/auth/__init__.py @@ -0,0 +1,11 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Auth import Access as Access +from .Auth import ProjectFlags as ProjectFlags +from .Auth import Group as Group +from .Auth import User as User +from .Auth import Auth as Auth +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/auth/dummy/Auth.py b/src/python/jwutils/auth/dummy/Auth.py new file mode 100644 index 0000000..b1be6b0 --- /dev/null +++ b/src/python/jwutils/auth/dummy/Auth.py @@ -0,0 +1,10 @@ +# ruff: noqa: E501 +from jw.util.auth.dummy.Auth import Group as Group +from jw.util.auth.dummy.Auth import User as User +from jw.util.auth.dummy.Auth import Auth as Auth + +__all__ = [ + "Group", + "User", + "Auth", +] diff --git a/src/python/jwutils/auth/dummy/Makefile b/src/python/jwutils/auth/dummy/Makefile new file mode 100644 index 0000000..5897663 --- /dev/null +++ b/src/python/jwutils/auth/dummy/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/auth/dummy/__init__.py b/src/python/jwutils/auth/dummy/__init__.py new file mode 100644 index 0000000..bb8b8ba --- /dev/null +++ b/src/python/jwutils/auth/dummy/__init__.py @@ -0,0 +1,9 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Auth import Group as Group +from .Auth import User as User +from .Auth import Auth as Auth +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/auth/ldap/Auth.py b/src/python/jwutils/auth/ldap/Auth.py new file mode 100644 index 0000000..dcc4865 --- /dev/null +++ b/src/python/jwutils/auth/ldap/Auth.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.auth.ldap.Auth import Group as Group +from jw.util.auth.ldap.Auth import Auth as Auth + +__all__ = [ + "Group", + "Auth", +] diff --git a/src/python/jwutils/auth/ldap/Makefile b/src/python/jwutils/auth/ldap/Makefile new file mode 100644 index 0000000..5897663 --- /dev/null +++ b/src/python/jwutils/auth/ldap/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/auth/ldap/__init__.py b/src/python/jwutils/auth/ldap/__init__.py new file mode 100644 index 0000000..d289aa9 --- /dev/null +++ b/src/python/jwutils/auth/ldap/__init__.py @@ -0,0 +1,8 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Auth import Group as Group +from .Auth import Auth as Auth +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/cast.py b/src/python/jwutils/cast.py new file mode 100644 index 0000000..88bc824 --- /dev/null +++ b/src/python/jwutils/cast.py @@ -0,0 +1,18 @@ +# ruff: noqa: E501 +from jw.util.cast import cast_str_to_timedelta as cast_str_to_timedelta +from jw.util.cast import cast_str_to_int as cast_str_to_int +from jw.util.cast import cast_str_to_bool as cast_str_to_bool +from jw.util.cast import guess_type as guess_type +from jw.util.cast import from_str as from_str +from jw.util.cast import from_env as from_env +from jw.util.cast import cast_str as cast_str + +__all__ = [ + "cast_str_to_timedelta", + "cast_str_to_int", + "cast_str_to_bool", + "guess_type", + "from_str", + "from_env", + "cast_str", +] diff --git a/src/python/jwutils/db/DataBase.py b/src/python/jwutils/db/DataBase.py new file mode 100644 index 0000000..cee5a38 --- /dev/null +++ b/src/python/jwutils/db/DataBase.py @@ -0,0 +1,7 @@ +# ruff: noqa: E501 + +from jw.util.db.DataBase import DataBase as DataBase + +__all__ = [ + "DataBase", +] diff --git a/tools/python/jwutils/auth/Makefile b/src/python/jwutils/db/Makefile similarity index 76% rename from tools/python/jwutils/auth/Makefile rename to src/python/jwutils/db/Makefile index 59b3ac1..b54ec56 100644 --- a/tools/python/jwutils/auth/Makefile +++ b/src/python/jwutils/db/Makefile @@ -1,4 +1,5 @@ TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false include $(TOPDIR)/make/proj.mk include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/db/Session.py b/src/python/jwutils/db/Session.py new file mode 100644 index 0000000..d525e13 --- /dev/null +++ b/src/python/jwutils/db/Session.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.Session import Session as Session + +__all__ = [ + "Session", +] diff --git a/src/python/jwutils/db/TableIoHandler.py b/src/python/jwutils/db/TableIoHandler.py new file mode 100644 index 0000000..4cb083f --- /dev/null +++ b/src/python/jwutils/db/TableIoHandler.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.TableIoHandler import TableIoHandler as TableIoHandler + +__all__ = [ + "TableIoHandler", +] diff --git a/src/python/jwutils/db/__init__.py b/src/python/jwutils/db/__init__.py new file mode 100644 index 0000000..a35a4f1 --- /dev/null +++ b/src/python/jwutils/db/__init__.py @@ -0,0 +1,17 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .rows import rows_pretty as rows_pretty +from .rows import rows_duplicates as rows_duplicates +from .rows import rows_remove as rows_remove +from .rows import rows_select as rows_select +from .rows import rows_rewrite_regex as rows_rewrite_regex +from .rows import rows_check_not_null as rows_check_not_null +from .rows import rows_dumps as rows_dumps +from .rows import rows_dump as rows_dump +from .rows import rows_to_csv as rows_to_csv +from .Session import Session as Session +from .TableIoHandler import TableIoHandler as TableIoHandler +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/db/query/Makefile b/src/python/jwutils/db/query/Makefile new file mode 100644 index 0000000..5897663 --- /dev/null +++ b/src/python/jwutils/db/query/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/db/query/Queries.py b/src/python/jwutils/db/query/Queries.py new file mode 100644 index 0000000..d2fba9f --- /dev/null +++ b/src/python/jwutils/db/query/Queries.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.query.Queries import Queries as Queries + +__all__ = [ + "Queries", +] diff --git a/src/python/jwutils/db/query/Query.py b/src/python/jwutils/db/query/Query.py new file mode 100644 index 0000000..bc0ec35 --- /dev/null +++ b/src/python/jwutils/db/query/Query.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.query.Query import Query as Query + +__all__ = [ + "Query", +] diff --git a/src/python/jwutils/db/query/QueryResult.py b/src/python/jwutils/db/query/QueryResult.py new file mode 100644 index 0000000..41a73b2 --- /dev/null +++ b/src/python/jwutils/db/query/QueryResult.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.db.query.QueryResult import ResType as ResType +from jw.util.db.query.QueryResult import QueryResult as QueryResult + +__all__ = [ + "ResType", + "QueryResult", +] diff --git a/src/python/jwutils/db/query/__init__.py b/src/python/jwutils/db/query/__init__.py new file mode 100644 index 0000000..338f74a --- /dev/null +++ b/src/python/jwutils/db/query/__init__.py @@ -0,0 +1,10 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Queries import Queries as Queries +from .Query import Query as Query +from .QueryResult import ResType as ResType +from .QueryResult import QueryResult as QueryResult +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/db/rows.py b/src/python/jwutils/db/rows.py new file mode 100644 index 0000000..b4bbe95 --- /dev/null +++ b/src/python/jwutils/db/rows.py @@ -0,0 +1,22 @@ +# ruff: noqa: E501 +from jw.util.db.rows import rows_pretty as rows_pretty +from jw.util.db.rows import rows_duplicates as rows_duplicates +from jw.util.db.rows import rows_remove as rows_remove +from jw.util.db.rows import rows_select as rows_select +from jw.util.db.rows import rows_rewrite_regex as rows_rewrite_regex +from jw.util.db.rows import rows_check_not_null as rows_check_not_null +from jw.util.db.rows import rows_dumps as rows_dumps +from jw.util.db.rows import rows_dump as rows_dump +from jw.util.db.rows import rows_to_csv as rows_to_csv + +__all__ = [ + "rows_pretty", + "rows_duplicates", + "rows_remove", + "rows_select", + "rows_rewrite_regex", + "rows_check_not_null", + "rows_dumps", + "rows_dump", + "rows_to_csv", +] diff --git a/src/python/jwutils/db/schema/Column.py b/src/python/jwutils/db/schema/Column.py new file mode 100644 index 0000000..bbc7af2 --- /dev/null +++ b/src/python/jwutils/db/schema/Column.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.Column import Column as Column + +__all__ = [ + "Column", +] diff --git a/src/python/jwutils/db/schema/ColumnSet.py b/src/python/jwutils/db/schema/ColumnSet.py new file mode 100644 index 0000000..937060c --- /dev/null +++ b/src/python/jwutils/db/schema/ColumnSet.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.ColumnSet import ColumnSet as ColumnSet + +__all__ = [ + "ColumnSet", +] diff --git a/src/python/jwutils/db/schema/CompositeForeignKey.py b/src/python/jwutils/db/schema/CompositeForeignKey.py new file mode 100644 index 0000000..1d3d49f --- /dev/null +++ b/src/python/jwutils/db/schema/CompositeForeignKey.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.CompositeForeignKey import CompositeForeignKey as CompositeForeignKey + +__all__ = [ + "CompositeForeignKey", +] diff --git a/src/python/jwutils/db/schema/DataType.py b/src/python/jwutils/db/schema/DataType.py new file mode 100644 index 0000000..2e0fbe4 --- /dev/null +++ b/src/python/jwutils/db/schema/DataType.py @@ -0,0 +1,10 @@ +# ruff: noqa: E501 +from jw.util.db.schema.DataType import py_type as py_type +from jw.util.db.schema.DataType import Id as Id +from jw.util.db.schema.DataType import DataType as DataType + +__all__ = [ + "py_type", + "Id", + "DataType", +] diff --git a/src/python/jwutils/db/schema/Makefile b/src/python/jwutils/db/schema/Makefile new file mode 100644 index 0000000..5897663 --- /dev/null +++ b/src/python/jwutils/db/schema/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/db/schema/Schema.py b/src/python/jwutils/db/schema/Schema.py new file mode 100644 index 0000000..e96ef99 --- /dev/null +++ b/src/python/jwutils/db/schema/Schema.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.Schema import Schema as Schema + +__all__ = [ + "Schema", +] diff --git a/src/python/jwutils/db/schema/SingleForeignKey.py b/src/python/jwutils/db/schema/SingleForeignKey.py new file mode 100644 index 0000000..cdee73d --- /dev/null +++ b/src/python/jwutils/db/schema/SingleForeignKey.py @@ -0,0 +1,3 @@ +# ruff: noqa: E501 + +__all__ = [] diff --git a/src/python/jwutils/db/schema/Table.py b/src/python/jwutils/db/schema/Table.py new file mode 100644 index 0000000..1e9cd0c --- /dev/null +++ b/src/python/jwutils/db/schema/Table.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.Table import Table as Table + +__all__ = [ + "Table", +] diff --git a/src/python/jwutils/db/schema/__init__.py b/src/python/jwutils/db/schema/__init__.py new file mode 100644 index 0000000..170548c --- /dev/null +++ b/src/python/jwutils/db/schema/__init__.py @@ -0,0 +1,14 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .Column import Column as Column +from .ColumnSet import ColumnSet as ColumnSet +from .CompositeForeignKey import CompositeForeignKey as CompositeForeignKey +from .DataType import py_type as py_type +from .DataType import DataType as DataType +from .Schema import Schema as Schema +from .Table import Table as Table +from .utils import check_schema as check_schema +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/db/schema/utils.py b/src/python/jwutils/db/schema/utils.py new file mode 100644 index 0000000..78c7cac --- /dev/null +++ b/src/python/jwutils/db/schema/utils.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.db.schema.utils import check_schema as check_schema + +__all__ = [ + "check_schema", +] diff --git a/src/python/jwutils/graph/Makefile b/src/python/jwutils/graph/Makefile new file mode 100644 index 0000000..b54ec56 --- /dev/null +++ b/src/python/jwutils/graph/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/graph/__init__.py b/src/python/jwutils/graph/__init__.py new file mode 100644 index 0000000..6625351 --- /dev/null +++ b/src/python/jwutils/graph/__init__.py @@ -0,0 +1,6 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/graph/yed/Makefile b/src/python/jwutils/graph/yed/Makefile new file mode 100644 index 0000000..5897663 --- /dev/null +++ b/src/python/jwutils/graph/yed/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/graph/yed/MapAttr2Shape.py b/src/python/jwutils/graph/yed/MapAttr2Shape.py new file mode 100644 index 0000000..1553a15 --- /dev/null +++ b/src/python/jwutils/graph/yed/MapAttr2Shape.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.graph.yed.MapAttr2Shape import MapAttr2Shape as MapAttr2Shape + +__all__ = [ + "MapAttr2Shape", +] diff --git a/src/python/jwutils/graph/yed/__init__.py b/src/python/jwutils/graph/yed/__init__.py new file mode 100644 index 0000000..37d9944 --- /dev/null +++ b/src/python/jwutils/graph/yed/__init__.py @@ -0,0 +1,7 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .MapAttr2Shape import MapAttr2Shape as MapAttr2Shape +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/ldap.py b/src/python/jwutils/ldap.py new file mode 100644 index 0000000..c95c196 --- /dev/null +++ b/src/python/jwutils/ldap.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.ldap import Connection as Connection +from jw.util.ldap import default_config as default_config + +__all__ = [ + "Connection", + "default_config", +] diff --git a/src/python/jwutils/log.py b/src/python/jwutils/log.py new file mode 100644 index 0000000..e5de720 --- /dev/null +++ b/src/python/jwutils/log.py @@ -0,0 +1,45 @@ +# ruff: noqa: E501 +from jw.util.log import OFF as OFF +from jw.util.log import DEBUG as DEBUG +from jw.util.log import INFO as INFO +from jw.util.log import NOTICE as NOTICE +from jw.util.log import WARNING as WARNING +from jw.util.log import ERR as ERR + +from jw.util.log import prio_gets_logged as prio_gets_logged +from jw.util.log import log_level as log_level +from jw.util.log import slog_m as slog_m +from jw.util.log import slog as slog +from jw.util.log import parse_log_prio_str as parse_log_prio_str +from jw.util.log import console_color_chars as console_color_chars +from jw.util.log import get_caller_pos as get_caller_pos +from jw.util.log import set_level as set_level +from jw.util.log import set_flags as set_flags +from jw.util.log import append_to_prefix as append_to_prefix +from jw.util.log import remove_from_prefix as remove_from_prefix +from jw.util.log import set_filename_length as set_filename_length +from jw.util.log import set_module_name_length as set_module_name_length +from jw.util.log import add_log_file as add_log_file + +__all__ = [ + "OFF", + "DEBUG", + "INFO", + "NOTICE", + "WARNING", + "ERR", + "prio_gets_logged", + "log_level", + "slog_m", + "slog", + "parse_log_prio_str", + "console_color_chars", + "get_caller_pos", + "set_level", + "set_flags", + "append_to_prefix", + "remove_from_prefix", + "set_filename_length", + "set_module_name_length", + "add_log_file", +] diff --git a/src/python/jwutils/misc.py b/src/python/jwutils/misc.py new file mode 100644 index 0000000..89f3a13 --- /dev/null +++ b/src/python/jwutils/misc.py @@ -0,0 +1,28 @@ +# ruff: noqa: E501 +from jw.util.misc import silentremove as silentremove +from jw.util.misc import atomic_store as atomic_store +from jw.util.misc import object_builtin_name as object_builtin_name +from jw.util.misc import get_derived_classes as get_derived_classes +from jw.util.misc import load_classes as load_classes +from jw.util.misc import load_class as load_class +from jw.util.misc import load_class_names as load_class_names +from jw.util.misc import load_object as load_object +from jw.util.misc import load_function as load_function +from jw.util.misc import commit_tmpfile as commit_tmpfile +from jw.util.misc import multi_regex_edit as multi_regex_edit +from jw.util.misc import dump as dump + +__all__ = [ + "silentremove", + "atomic_store", + "object_builtin_name", + "get_derived_classes", + "load_classes", + "load_class", + "load_class_names", + "load_object", + "load_function", + "commit_tmpfile", + "multi_regex_edit", + "dump", +] diff --git a/src/python/jwutils/multi_key_dict.py b/src/python/jwutils/multi_key_dict.py new file mode 100644 index 0000000..cdee73d --- /dev/null +++ b/src/python/jwutils/multi_key_dict.py @@ -0,0 +1,3 @@ +# ruff: noqa: E501 + +__all__ = [] diff --git a/src/python/jwutils/replace.sh b/src/python/jwutils/replace.sh new file mode 100644 index 0000000..5dc43d6 --- /dev/null +++ b/src/python/jwutils/replace.sh @@ -0,0 +1,32 @@ +cat_stub_py() +{ + echo "# ruff: noqa: E501" + local sym + for sym in $syms; do + echo "from jw.util.$mod import $sym as $sym" + done + echo + echo "__all__ = [" + for sym in $syms; do + echo " \"$sym\"," + done + echo "]" +} + +for p in $(git -C ../jw/util ls-files | grep '\.py$' | grep -v __init__.py); do + f=../jw/util/$p + mod=$(echo $p | sed 's|\.py$||; s|/|.|g') + base=${mod##*.} + init=$(dirname $f)/__init__.py + syms=$(sed "/from \.$base /!d; s/from \.$base import //; s/ .*//" $init | xargs) + echo mod=$mod + echo base=$base + echo syms=$syms + echo + cat_stub_py > $p + #grep $base $init | sed 's|from |from jw.util|' > $f + #cat <<-EOT > $f + #from $mod import * + #EOT + #git rshow HEAD:./$f > $f +done diff --git a/src/python/jwutils/stree/Makefile b/src/python/jwutils/stree/Makefile new file mode 100644 index 0000000..b54ec56 --- /dev/null +++ b/src/python/jwutils/stree/Makefile @@ -0,0 +1,5 @@ +TOPDIR = ../../../.. +PY_UPDATE_INIT_PY = false + +include $(TOPDIR)/make/proj.mk +include $(JWBDIR)/make/py-mod.mk diff --git a/src/python/jwutils/stree/StringTree.py b/src/python/jwutils/stree/StringTree.py new file mode 100644 index 0000000..5acadfd --- /dev/null +++ b/src/python/jwutils/stree/StringTree.py @@ -0,0 +1,6 @@ +# ruff: noqa: E501 +from jw.util.stree.StringTree import StringTree as StringTree + +__all__ = [ + "StringTree", +] diff --git a/src/python/jwutils/stree/__init__.py b/src/python/jwutils/stree/__init__.py new file mode 100644 index 0000000..27e069e --- /dev/null +++ b/src/python/jwutils/stree/__init__.py @@ -0,0 +1,9 @@ +# >> -------------------------- generated by python-tools.sh >> +# ruff: noqa: E501 +from pkgutil import extend_path + +__path__ = extend_path(__path__, __name__) +from .serdes import parse as parse +from .serdes import read as read +from .StringTree import StringTree as StringTree +# << -------------------------- generated by python-tools.sh << diff --git a/src/python/jwutils/stree/serdes.py b/src/python/jwutils/stree/serdes.py new file mode 100644 index 0000000..568436d --- /dev/null +++ b/src/python/jwutils/stree/serdes.py @@ -0,0 +1,8 @@ +# ruff: noqa: E501 +from jw.util.stree.serdes import parse as parse +from jw.util.stree.serdes import read as read + +__all__ = [ + "parse", + "read", +] diff --git a/tools/python/jwutils/graph/Makefile b/tools/python/jwutils/graph/Makefile deleted file mode 100644 index 59b3ac1..0000000 --- a/tools/python/jwutils/graph/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -TOPDIR = ../../../.. - -include $(TOPDIR)/make/proj.mk -include $(JWBDIR)/make/py-mod.mk diff --git a/tools/python/jwutils/stree/Makefile b/tools/python/jwutils/stree/Makefile deleted file mode 100644 index 59b3ac1..0000000 --- a/tools/python/jwutils/stree/Makefile +++ /dev/null @@ -1,4 +0,0 @@ -TOPDIR = ../../../.. - -include $(TOPDIR)/make/proj.mk -include $(JWBDIR)/make/py-mod.mk