X-Git-Url: https://disinclined.org/git/?a=blobdiff_plain;f=publish_notes.py;h=4b711d963a9347ca75a8840847b78bb65da4f8ba;hb=eb9db23304d0f3ad3462bf192c6c0837cb79e6a7;hp=2f99dc61e5404df72c54f5c0493038bf0d2b731a;hpb=f870b65ad60d8ea7456384d38f8db6fd01275990;p=dylansserver.git diff --git a/publish_notes.py b/publish_notes.py index 2f99dc6..4b711d9 100755 --- a/publish_notes.py +++ b/publish_notes.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python2 NOTES_DIRECTORY = '/home/dylan/docs/notes' @@ -8,7 +8,7 @@ import MySQLdb as db import ConfigParser config = ConfigParser.RawConfigParser() -config.read('/etc/dylanstestserver.ini') +config.read('/etc/dylansserver.ini') domain = config.get('database', 'domain') user = config.get('database', 'user') password = config.get('database', 'password').replace('"', '') @@ -25,6 +25,7 @@ for row in results: existing_titles.append(row[0]) for note in notes: + if note[:1] == '.': continue if note == 'index.php' or note == 'notes.php': continue url = note[:note.index('.')] f = open(os.path.join(NOTES_DIRECTORY, note)) @@ -36,5 +37,5 @@ for note in notes: VALUES(\"%s\", \"%s\", \"%s\", \"%s\")"\ % (time.strftime("%Y/%m/%d %I:%M:00", date_posted), url, title, db.escape_string(text)) - #print sql - cursor.execute(sql) + print sql + #cursor.execute(sql)