mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Added basics comments
This commit is contained in:
23
install
vendored
23
install
vendored
@@ -1,21 +1,22 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/python3.8
|
||||
import json
|
||||
import pathlib
|
||||
|
||||
from src.backend.lib.config import Config
|
||||
from pprint import pprint
|
||||
# from src.backend.lib.config import Config # Use ptShelfs configuration class or stay independant for portability?
|
||||
from src.backend.lib.display import TerminalDisplay
|
||||
|
||||
PRG_PATH = pathlib.Path.cwd()
|
||||
LIB_PATH = pathlib.Path.joinpath(PRG_PATH, "src", "backend", "lib")
|
||||
# PRG_PATH = pathlib.Path.cwd()
|
||||
# LIB_PATH = pathlib.Path.joinpath(PRG_PATH, "src", "backend", "lib")
|
||||
# sys.path.insert(0, PRG_PATH)
|
||||
|
||||
TerminalDisplay().installer()
|
||||
# Call for the ui and installer questions.
|
||||
install_answers = TerminalDisplay().installer()
|
||||
|
||||
|
||||
class Configuration:
|
||||
def __init__(self):
|
||||
_cp = pathlib.Path("config.json")
|
||||
_data = self.open_file()
|
||||
self._cp = pathlib.Path("config.json")
|
||||
self._data = self.open_file()
|
||||
|
||||
def open_file(self):
|
||||
with open(str(self._cp), "r") as read_file:
|
||||
@@ -26,3 +27,9 @@ class Configuration:
|
||||
with open(str(self._cp), "rw") as write_file:
|
||||
json.dumps(write_file)
|
||||
return True
|
||||
|
||||
|
||||
config = Configuration().open_file()
|
||||
# Print a comparison between config.json and user inputs.
|
||||
pprint(install_answers)
|
||||
pprint(config)
|
||||
|
||||
Reference in New Issue
Block a user