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 <jan@janware.com>
This commit is contained in:
parent
bc7652fdf9
commit
a2684dd601
129 changed files with 678 additions and 52 deletions
4
src/python/jw/Makefile
Normal file
4
src/python/jw/Makefile
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
TOPDIR = ../../..
|
||||
|
||||
include $(TOPDIR)/make/proj.mk
|
||||
include $(JWBDIR)/make/py-ns-dir.mk
|
||||
3
src/python/jw/__init__.py
Normal file
3
src/python/jw/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from pkgutil import extend_path
|
||||
|
||||
__path__ = extend_path(__path__, __name__)
|
||||
|
|
@ -4,7 +4,7 @@ import argparse
|
|||
|
||||
from collections import OrderedDict
|
||||
|
||||
from jwutils.log import *
|
||||
from .log import slog
|
||||
|
||||
class ArgsContainer: # export
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
||||
|
|
@ -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 *
|
||||
|
||||
6
src/python/jw/util/Makefile
Normal file
6
src/python/jw/util/Makefile
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
TOPDIR = ../../../..
|
||||
|
||||
PY_UPDATE_INIT_PY ?= false
|
||||
|
||||
include $(TOPDIR)/make/proj.mk
|
||||
include $(JWBDIR)/make/py-mod.mk
|
||||
|
|
@ -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)
|
||||
3
src/python/jw/util/__init__.py
Normal file
3
src/python/jw/util/__init__.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
from pkgutil import extend_path
|
||||
|
||||
__path__ = extend_path(__path__, __name__)
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue