From 22c03ccc758b2f5c3f4eab827a23c8f19759d595 Mon Sep 17 00:00:00 2001 From: Vincent Zeng Date: Sun, 31 Dec 2017 12:52:23 -0500 Subject: [PATCH] cleaning up user init --- ttbp/ttbp.py | 105 +++++++++++++-------------------------------------- 1 file changed, 26 insertions(+), 79 deletions(-) diff --git a/ttbp/ttbp.py b/ttbp/ttbp.py index 722f1ad..185650c 100644 --- a/ttbp/ttbp.py +++ b/ttbp/ttbp.py @@ -54,9 +54,6 @@ __author__ = "endorphant to explore your feels.\n\n") @@ -254,12 +252,17 @@ def init(): raw_input(""" i don't recognize you, stranger. let's make friends. -press to begin, or to get out of here. - """) +press to begin, or to get out of here.""") except KeyboardInterrupt: print("\n\nthanks for checking in! i'll always be here.\n\n") quit() + print("\nokay! gimme a second to get you set up!") + + time.sleep(1) + print("...") + time.sleep(1) + ## record user in source list users = open(config.USERFILE, 'a') users.write(config.USER+"\n") @@ -268,6 +271,7 @@ press to begin, or to get out of here. #subprocess.call(['chmod', 'a+w', config.USERFILE]) ## make .ttbp directory structure + print("\ngenerating feels at {path}...".format(path=config.PATH).rstrip()) subprocess.call(["mkdir", config.PATH]) subprocess.call(["mkdir", config.USER_CONFIG]) subprocess.call(["mkdir", config.USER_DATA]) @@ -289,10 +293,13 @@ press to begin, or to get out of here. f.write(config.DEFAULT_STYLE) ## run user-interactive setup and load core engine + time.sleep(1) + print("done setting up feels!") + print("\nthese are the default settings. you can change any of them now, or change them later at any time!!") setup() core.load(SETTINGS) - #raw_input("\nyou're all good to go, "+chatter.say("friend")+"! hit to continue.\n\n") + raw_input("\nyou're all good to go, "+chatter.say("friend")+"! hit to continue.\n\n") return "" def gen_header(): @@ -369,7 +376,7 @@ def setup_repair(): global SETTINGS - print("\nyour ttbp configuration doesn't look right. let's make you a fresh copy.\n\n") + print("\nyour ttbp configuration doesn't look right. let me try to fix it....\n\n") settings_map = { "editor": select_editor, @@ -386,30 +393,10 @@ def setup_repair(): update_publishing() core.reload_ttbprc(SETTINGS) save_settings() - ''' - if SETTINGS.get("editor", None) is None: - SETTINGS.update({"editor": "not set"}) - SETTINGS.update({"editor": select_editor()}) - if SETTINGS.get("publishing", None) is None: - SETTINGS.update({"publishing": "not set"}) - SETTINGS.update({"publishing": select_publishing()}) - ''' - - ''' - SETTINGS = { - "editor": "none", - "publish dir": False, - "publishing": False, - "gopher": False, - } - - try: - setup() - except KeyboardInterrupt: - print("\n\nsorry, trying again.\n\n") - setup() - ''' + print("...") + time.sleep(1) + raw_input("\nyou're all good to go, "+chatter.say("friend")+"! hit to continue.\n\n") def setup(): ''' @@ -1090,46 +1077,6 @@ def update_gopher(): ##### PATCHING UTILITIES -""" -def build_mismatch(): - ''' - checks to see if user's last run build is the same as this session - ''' - - versionFile = os.path.join(config.PATH, "version") - if not os.path.exists(versionFile): - return False - - ver = open(versionFile, "r").read().rstrip() - if ver[-1] == __version__[-1]: - return False - - return ver - -def switch_build(ver): - ''' - switches user between beta and stable builds - ''' - - if __version__[-1] == 'b': - build = "beta" - ver += "b" - else: - build = "stable" - ver = ver[0:-1] - - # write user versionfile - ''' - print("\nswitching you over to the "+build+" version...\n") - time.sleep(1) - print("...") - ''' - versionFile = os.path.join(config.PATH, "version") - open(versionFile, "w").write(ver) - time.sleep(1) - #print("\nall good!\n") -""" - def updated(): ''' checks to see if current user is up to the same version as system