forked from endorphant/ttbp
wrestling with unpublishing for backup/purging
parent
1386968c34
commit
48e61c9227
11
ttbp/ttbp.py
11
ttbp/ttbp.py
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue