From 5bf0c207a395d1884b8692ba0a3bcfa8052db599 Mon Sep 17 00:00:00 2001 From: endorphant Date: Sat, 30 Apr 2016 00:00:55 -0400 Subject: [PATCH] adding some meta stuff --- bin/core.py | 12 ++++++++---- bin/update.py | 5 +++++ 2 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 bin/update.py diff --git a/bin/core.py b/bin/core.py index a4b769a..addee2e 100644 --- a/bin/core.py +++ b/bin/core.py @@ -2,9 +2,11 @@ import os -WWW = os.path.join("..","www") -CONFIG = os.path.join("config") -DATA = os.path.join("..", "data") +PATH = os.path.join("/home", "endorphant", "projects", "ttbp", "bin") +WWW = os.path.join(PATH, "..","www") +CONFIG = os.path.join(PATH, "config") +DATA = os.path.join(os.path.expanduser("~"), ".ttbp", "entries") +#DATA = os.path.join("..", "data") MONTHS = { "01":"january", @@ -32,7 +34,7 @@ for file in os.listdir(DATA): FILES.append(file) FILES.reverse() -print FILES +print("found: "+str(FILES)) def write(outurl="default.html"): outfile = open(os.path.join(WWW, outurl), "w") @@ -52,6 +54,8 @@ def write(outurl="default.html"): outfile.close() + return os.path.join(WWW, outurl) + def write_entry(file): # dump given file into entry format, return as list of strings diff --git a/bin/update.py b/bin/update.py new file mode 100644 index 0000000..cf56c50 --- /dev/null +++ b/bin/update.py @@ -0,0 +1,5 @@ +#!/usr/bin/python + +import core + +print("\n blog updated at "+core.write("index.html")+"\n")