mirror of
https://github.com/th3r00t/pyShelf.git
synced 2026-04-28 01:59:35 -04:00
Change the way config is called
This commit is contained in:
9
configure
vendored
9
configure
vendored
@@ -23,7 +23,6 @@ def write_config(config):
|
|||||||
def set_secret(config=load_config()):
|
def set_secret(config=load_config()):
|
||||||
if config["SECRET"] == "":
|
if config["SECRET"] == "":
|
||||||
config["SECRET"] = get_random_secret_key()
|
config["SECRET"] = get_random_secret_key()
|
||||||
write_config(config)
|
|
||||||
print(config["SECRET"])
|
print(config["SECRET"])
|
||||||
else:
|
else:
|
||||||
print("Secret already set, skipping.")
|
print("Secret already set, skipping.")
|
||||||
@@ -32,7 +31,6 @@ def set_book_directory(config=load_config(), *args):
|
|||||||
if config["BOOKPATH"] == "":
|
if config["BOOKPATH"] == "":
|
||||||
try: config["BOOKPATH"] = args[0]
|
try: config["BOOKPATH"] = args[0]
|
||||||
except IndexError: config["BOOKPATH"] = input("Input Book Directory ")
|
except IndexError: config["BOOKPATH"] = input("Input Book Directory ")
|
||||||
write_config(config)
|
|
||||||
|
|
||||||
def init_django_database():
|
def init_django_database():
|
||||||
cmds = [
|
cmds = [
|
||||||
@@ -46,7 +44,10 @@ def init_django_database():
|
|||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
os.chdir("../")
|
os.chdir("../")
|
||||||
|
|
||||||
set_secret()
|
config = load_config()
|
||||||
set_book_directory()
|
|
||||||
|
set_secret(config)
|
||||||
|
set_book_directory(config)
|
||||||
|
write_config(config)
|
||||||
init_django_database()
|
init_django_database()
|
||||||
Admin(Path.cwd()).createsuperuser()
|
Admin(Path.cwd()).createsuperuser()
|
||||||
|
|||||||
Reference in New Issue
Block a user