forked from endorphant/ttbp
started nopub feature
core file loading now checks files against a list of nopubs, stored in .ttbp/config/nopubmaster
parent
ed071ebb67
commit
cd63c6f09a
10
bin/core.py
10
bin/core.py
|
@ -17,6 +17,7 @@ WWW = os.path.join(PATH, "www")
|
|||
CONFIG = os.path.join(PATH, "config")
|
||||
DATA = os.path.join(PATH, "entries")
|
||||
FEED = os.path.join(SOURCE, "www", "index.html")
|
||||
NOPUB = os.path.join(CONFIG, "nopub")
|
||||
|
||||
HEADER = ""
|
||||
FOOTER = ""
|
||||
|
@ -34,8 +35,16 @@ def load():
|
|||
def load_files():
|
||||
global FILES
|
||||
|
||||
exclude = []
|
||||
|
||||
if os.path.isfile(NOPUB):
|
||||
for line in open(NOPUB, "r"):
|
||||
exclude.append(line.rstrip())
|
||||
|
||||
FILES = []
|
||||
for filename in os.listdir(DATA):
|
||||
if filename in exclude:
|
||||
continue
|
||||
filename = os.path.join(DATA, filename)
|
||||
if os.path.isfile(filename) and valid(filename):
|
||||
FILES.append(filename)
|
||||
|
@ -202,7 +211,6 @@ def write_global_feed(blogList):
|
|||
<p> </p>
|
||||
|
||||
<h3>live feels-sharing:</h3>
|
||||
<p><i>(time not exactly to scale)</i></p>
|
||||
<div class=\"feed\">
|
||||
<ul>
|
||||
""")
|
||||
|
|
|
@ -407,7 +407,7 @@ press <enter> to begin recording your feels.
|
|||
if publishing():
|
||||
core.load_files()
|
||||
core.write("index.html")
|
||||
left = "posted to "+LIVE+USER+"/"+SETTINGS["publish dir"]+"/index.html"
|
||||
left = "posted to "+LIVE+USER+"/"+SETTINGS["publish dir"]+"/index.html\n\n>"
|
||||
redraw(left + " thanks for sharing your feels!")
|
||||
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue