wrestling with unpublishing for backup/purging

master
Vincent Zeng 2018-03-22 18:43:45 -04:00
parent 1386968c34
commit 48e61c9227
1 changed files with 7 additions and 4 deletions

View File

@ -928,6 +928,7 @@ type the following purge code:
unpublish() unpublish()
if not subprocess.call(["rm", "-rf", config.MAIN_FEELS]): if not subprocess.call(["rm", "-rf", config.MAIN_FEELS]):
subprocess.call(["mkdir", config.MAIN_FEELS]) subprocess.call(["mkdir", config.MAIN_FEELS])
core.load_files()
print("ALL FEELS PURGED! you're ready to start fresh!") print("ALL FEELS PURGED! you're ready to start fresh!")
else: else:
print(""" print("""
@ -1044,6 +1045,8 @@ move it to {directory} and try running this tool again.\
subprocess.call(["mv", feel, config.MAIN_FEELS]) subprocess.call(["mv", feel, config.MAIN_FEELS])
time.sleep(.01) time.sleep(.01)
core.load_files()
tempdir = os.path.join(config.BACKUPS, os.path.splitext(os.path.splitext(os.path.basename(backups[choice]))[0])[0], "entries") tempdir = os.path.join(config.BACKUPS, os.path.splitext(os.path.splitext(os.path.basename(backups[choice]))[0])[0], "entries")
time.sleep(.5) time.sleep(.5)
@ -1522,7 +1525,8 @@ def unpublish():
publishDir = os.path.join(config.PUBLIC, directory) publishDir = os.path.join(config.PUBLIC, directory)
if os.path.exists(publishDir): if os.path.exists(publishDir):
subprocess.call(["rm", "-rf", publishDir]) subprocess.call(["rm", "-rf", publishDir])
os.mkdir(publishDir) #make_publish_dir(directory)
#SETTINGS.update({"publish dir": None})
if SETTINGS.get("gopher"): if SETTINGS.get("gopher"):
#SETTINGS.update({"gopher": False}) #SETTINGS.update({"gopher": False})
@ -1543,10 +1547,9 @@ def update_publishing():
subprocess.call(["rm", os.path.join(config.PUBLIC, oldDir)]) subprocess.call(["rm", os.path.join(config.PUBLIC, oldDir)])
make_publish_dir(newDir) make_publish_dir(newDir)
core.load_files() core.load_files()
core.write_html("index.html") #core.write_html("index.html")
else: else:
unpublish() unpublish()
SETTINGS.update({"publish dir": None})
core.load(SETTINGS) core.load(SETTINGS)
@ -1647,7 +1650,7 @@ def update_user_version():
# repopulate html files # repopulate html files
core.load_files() core.load_files()
core.write_html("index.html") #core.write_html("index.html")
# add publishing setting # add publishing setting
print("\nnew feature!\n") print("\nnew feature!\n")