From dada83ed81f40a976a6efa010a12a46d224d67b3 Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Sat, 28 Jan 2023 11:43:22 -0600 Subject: [PATCH] reorganizing prefs python code --- install | 3 ++- prefs/__init__.py | 5 +++++ {installer => prefs}/host.py | 0 installer/__init__.py => prefs/installer.py | 20 +++++--------------- {installer => prefs}/log.py | 0 {installer => prefs}/options.py | 3 ++- {installer => prefs}/pylintrc | 0 {installer => prefs}/sections.py | 0 {installer => prefs}/targets.py | 2 +- 9 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 prefs/__init__.py rename {installer => prefs}/host.py (100%) rename installer/__init__.py => prefs/installer.py (91%) rename {installer => prefs}/log.py (100%) rename {installer => prefs}/options.py (98%) rename {installer => prefs}/pylintrc (100%) rename {installer => prefs}/sections.py (100%) rename {installer => prefs}/targets.py (99%) diff --git a/install b/install index bcd9f28..c5d932c 100755 --- a/install +++ b/install @@ -2,6 +2,7 @@ """ installs preferences """ -from installer import Installer + +from prefs import Installer installer = Installer() installer.run() diff --git a/prefs/__init__.py b/prefs/__init__.py new file mode 100644 index 0000000..2b81710 --- /dev/null +++ b/prefs/__init__.py @@ -0,0 +1,5 @@ +""" +prefs is a preferences manager +""" + +from .installer import Installer diff --git a/installer/host.py b/prefs/host.py similarity index 100% rename from installer/host.py rename to prefs/host.py diff --git a/installer/__init__.py b/prefs/installer.py similarity index 91% rename from installer/__init__.py rename to prefs/installer.py index caf0b05..8a41f74 100644 --- a/installer/__init__.py +++ b/prefs/installer.py @@ -1,22 +1,12 @@ -""" -just exists to define our installer -""" - -import argparse -import json -import os import pathlib -import platform -import subprocess import sys -import shutil +import json from functools import cached_property -from installer import host -from installer.options import Options -from installer import log -from installer import targets -from installer import sections +from . import host +from . import sections +from . import targets +from .options import Options class Installer: """ diff --git a/installer/log.py b/prefs/log.py similarity index 100% rename from installer/log.py rename to prefs/log.py diff --git a/installer/options.py b/prefs/options.py similarity index 98% rename from installer/options.py rename to prefs/options.py index 7c7ebf3..0845942 100644 --- a/installer/options.py +++ b/prefs/options.py @@ -6,7 +6,8 @@ import argparse import configparser import pathlib -from installer import log, host +from . import log +from . import host class Options: """ diff --git a/installer/pylintrc b/prefs/pylintrc similarity index 100% rename from installer/pylintrc rename to prefs/pylintrc diff --git a/installer/sections.py b/prefs/sections.py similarity index 100% rename from installer/sections.py rename to prefs/sections.py diff --git a/installer/targets.py b/prefs/targets.py similarity index 99% rename from installer/targets.py rename to prefs/targets.py index e4740ba..50e46e0 100644 --- a/installer/targets.py +++ b/prefs/targets.py @@ -8,7 +8,7 @@ import shutil import os from functools import cached_property -from installer import host +from . import host class Target: """