forked from endorphant/ttbp
adding some meta stuff
parent
a94dd56f55
commit
5bf0c207a3
12
bin/core.py
12
bin/core.py
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
WWW = os.path.join("..","www")
|
PATH = os.path.join("/home", "endorphant", "projects", "ttbp", "bin")
|
||||||
CONFIG = os.path.join("config")
|
WWW = os.path.join(PATH, "..","www")
|
||||||
DATA = os.path.join("..", "data")
|
CONFIG = os.path.join(PATH, "config")
|
||||||
|
DATA = os.path.join(os.path.expanduser("~"), ".ttbp", "entries")
|
||||||
|
#DATA = os.path.join("..", "data")
|
||||||
|
|
||||||
MONTHS = {
|
MONTHS = {
|
||||||
"01":"january",
|
"01":"january",
|
||||||
|
@ -32,7 +34,7 @@ for file in os.listdir(DATA):
|
||||||
FILES.append(file)
|
FILES.append(file)
|
||||||
|
|
||||||
FILES.reverse()
|
FILES.reverse()
|
||||||
print FILES
|
print("found: "+str(FILES))
|
||||||
|
|
||||||
def write(outurl="default.html"):
|
def write(outurl="default.html"):
|
||||||
outfile = open(os.path.join(WWW, outurl), "w")
|
outfile = open(os.path.join(WWW, outurl), "w")
|
||||||
|
@ -52,6 +54,8 @@ def write(outurl="default.html"):
|
||||||
|
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
||||||
|
return os.path.join(WWW, outurl)
|
||||||
|
|
||||||
def write_entry(file):
|
def write_entry(file):
|
||||||
# dump given file into entry format, return as list of strings
|
# dump given file into entry format, return as list of strings
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
#!/usr/bin/python
|
||||||
|
|
||||||
|
import core
|
||||||
|
|
||||||
|
print("\n blog updated at "+core.write("index.html")+"\n")
|
Loading…
Reference in New Issue