diff --git a/bin/gencode_python b/bin/gencode_python index 6e1dda1d1..e9101a9f0 100755 --- a/bin/gencode_python +++ b/bin/gencode_python @@ -263,19 +263,14 @@ def generate_class(contents): def generate_module(in_files): shutil.rmtree(OUT_DIR, ignore_errors=True) os.makedirs(OUT_DIR, exist_ok=True) + udmi_dir = os.path.dirname(OUT_DIR) + python_dir = os.path.dirname(udmi_dir) - parts = OUT_DIR.split(os.sep) - python_dir = os.path.join(*parts[0:2]) - udmi_dir = os.path.join(*parts[0:3]) + open(os.path.join(udmi_dir, '__init__.py'), 'w').close() + open(os.path.join(python_dir, '__init__.py'), 'w').close() - python_init_path = os.path.join(python_dir, '__init__.py') - open(python_init_path, 'w').close() - - udmi_init_path = os.path.join(udmi_dir, '__init__.py') - open(udmi_init_path, 'w').close() - - schema_init_path = os.path.join(OUT_DIR, '__init__.py') - with open(schema_init_path, 'w') as fd: + full_path = os.path.join(OUT_DIR, '__init__.py') + with open(full_path, 'w') as fd: writer = lambda line: fd.write(line + '\n') for in_file in in_files: try: diff --git a/misc/udmi4py/.gitignore b/misc/pyudmi/.gitignore similarity index 100% rename from misc/udmi4py/.gitignore rename to misc/pyudmi/.gitignore diff --git a/misc/udmi4py/LICENSE b/misc/pyudmi/LICENSE similarity index 100% rename from misc/udmi4py/LICENSE rename to misc/pyudmi/LICENSE diff --git a/misc/udmi4py/README.md b/misc/pyudmi/README.md similarity index 100% rename from misc/udmi4py/README.md rename to misc/pyudmi/README.md diff --git a/misc/udmi4py/poetry.lock b/misc/pyudmi/poetry.lock similarity index 100% rename from misc/udmi4py/poetry.lock rename to misc/pyudmi/poetry.lock diff --git a/misc/udmi4py/pyproject.toml b/misc/pyudmi/pyproject.toml similarity index 96% rename from misc/udmi4py/pyproject.toml rename to misc/pyudmi/pyproject.toml index a889b43f4..5fb893743 100644 --- a/misc/udmi4py/pyproject.toml +++ b/misc/pyudmi/pyproject.toml @@ -1,5 +1,5 @@ [project] -name = "udmi4py" +name = "pyudmi" version = "0.1.0" description = "A Python library for UDMI" authors = [ diff --git a/misc/udmi4py/src/__init__.py b/misc/pyudmi/src/__init__.py similarity index 100% rename from misc/udmi4py/src/__init__.py rename to misc/pyudmi/src/__init__.py diff --git a/misc/udmi4py/src/client/__init__.py b/misc/pyudmi/src/client/__init__.py similarity index 100% rename from misc/udmi4py/src/client/__init__.py rename to misc/pyudmi/src/client/__init__.py diff --git a/misc/udmi4py/src/client/manager/__init__.py b/misc/pyudmi/src/client/manager/__init__.py similarity index 100% rename from misc/udmi4py/src/client/manager/__init__.py rename to misc/pyudmi/src/client/manager/__init__.py diff --git a/misc/udmi4py/src/client/manager/base.py b/misc/pyudmi/src/client/manager/base.py similarity index 100% rename from misc/udmi4py/src/client/manager/base.py rename to misc/pyudmi/src/client/manager/base.py diff --git a/misc/udmi4py/src/client/manager/discovery_manager.py b/misc/pyudmi/src/client/manager/discovery_manager.py similarity index 100% rename from misc/udmi4py/src/client/manager/discovery_manager.py rename to misc/pyudmi/src/client/manager/discovery_manager.py diff --git a/misc/udmi4py/tests/__init__.py b/misc/pyudmi/tests/__init__.py similarity index 100% rename from misc/udmi4py/tests/__init__.py rename to misc/pyudmi/tests/__init__.py