mirror of
https://github.com/tildeclub/ttbp.git
synced 2026-06-22 04:09:25 +00:00
adding environment validator and nopub clearer
on startup, ttbp checks to see if the environment is valid, and prompts user to run setup again if not. also, nopub files are now removed from html if they were generated.
This commit is contained in:
12
bin/core.py
12
bin/core.py
@@ -69,6 +69,15 @@ def load(ttbprc={}):
|
||||
|
||||
load_files()
|
||||
|
||||
def reload_ttbprc(ttbprc={}):
|
||||
'''
|
||||
reloads new ttbprc into current session
|
||||
'''
|
||||
|
||||
global SETTINGS
|
||||
|
||||
SETTINGS = ttbprc
|
||||
|
||||
def load_files():
|
||||
'''
|
||||
file loader
|
||||
@@ -83,6 +92,9 @@ def load_files():
|
||||
|
||||
for filename in os.listdir(DATA):
|
||||
if nopub(filename):
|
||||
link = os.path.join(WWW, os.path.splitext(os.path.basename(filename))[0]+".html")
|
||||
if os.path.exists(link):
|
||||
subprocess.call(["rm", link])
|
||||
continue
|
||||
filename = os.path.join(DATA, filename)
|
||||
if os.path.isfile(filename) and valid(filename):
|
||||
|
||||
Reference in New Issue
Block a user