Added basics comments

This commit is contained in:
Raelon Masters
2019-12-25 22:37:20 -05:00
parent 5b81252f4f
commit ee96fbb85d
3 changed files with 16 additions and 12 deletions

View File

@@ -1,4 +0,0 @@
import sys
# sys.path.insert(1, "app/")
# sys.path.insert(2, "frontend/")

23
install vendored
View File

@@ -1,21 +1,22 @@
#!/usr/bin/python #!/usr/bin/python3.8
import json import json
import pathlib import pathlib
from pprint import pprint
from src.backend.lib.config import Config # from src.backend.lib.config import Config # Use ptShelfs configuration class or stay independant for portability?
from src.backend.lib.display import TerminalDisplay from src.backend.lib.display import TerminalDisplay
PRG_PATH = pathlib.Path.cwd() # PRG_PATH = pathlib.Path.cwd()
LIB_PATH = pathlib.Path.joinpath(PRG_PATH, "src", "backend", "lib") # LIB_PATH = pathlib.Path.joinpath(PRG_PATH, "src", "backend", "lib")
# sys.path.insert(0, PRG_PATH) # sys.path.insert(0, PRG_PATH)
TerminalDisplay().installer() # Call for the ui and installer questions.
install_answers = TerminalDisplay().installer()
class Configuration: class Configuration:
def __init__(self): def __init__(self):
_cp = pathlib.Path("config.json") self._cp = pathlib.Path("config.json")
_data = self.open_file() self._data = self.open_file()
def open_file(self): def open_file(self):
with open(str(self._cp), "r") as read_file: with open(str(self._cp), "r") as read_file:
@@ -26,3 +27,9 @@ class Configuration:
with open(str(self._cp), "rw") as write_file: with open(str(self._cp), "rw") as write_file:
json.dumps(write_file) json.dumps(write_file)
return True return True
config = Configuration().open_file()
# Print a comparison between config.json and user inputs.
pprint(install_answers)
pprint(config)

1
requirements.txt vendored
View File

@@ -15,3 +15,4 @@ toml
uwsgi uwsgi
django-debug-toolbar django-debug-toolbar
psycopg2-binary psycopg2-binary
prompt_toolkit