disinclined.org
/
git
/
dylansserver.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Recaptcha form cleaned up
[dylansserver.git]
/
publish_notes.py
diff --git
a/publish_notes.py
b/publish_notes.py
index
8663f9c
..
331030c
100755
(executable)
--- a/
publish_notes.py
+++ b/
publish_notes.py
@@
-25,17
+25,17
@@
for row in results:
existing_titles.append(row[0])
for note in notes:
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))
title = str(f.readline()[:-1])
if note == 'index.php' or note == 'notes.php': continue
url = note[:note.index('.')]
f = open(os.path.join(NOTES_DIRECTORY, note))
title = str(f.readline()[:-1])
+ date_posted = time.strptime(str(f.readline()[:-1]), "%Y/%m/%d %I:%M%p")
text = ''.join(f.readlines()) #converts list to single string
if title in existing_titles: continue
text = ''.join(f.readlines()) #converts list to single string
if title in existing_titles: continue
- mtime = time.localtime(os.path.getmtime(os.path.join(NOTES_DIRECTORY, note)))
- date_posted = "%s-%s-%s" % (str(mtime.tm_year)[2:], mtime.tm_mon, mtime.tm_mday)
sql = "INSERT INTO notes (date_posted, url, title, text)\
VALUES(\"%s\", \"%s\", \"%s\", \"%s\")"\
sql = "INSERT INTO notes (date_posted, url, title, text)\
VALUES(\"%s\", \"%s\", \"%s\", \"%s\")"\
- % (
date_posted
, url, title, db.escape_string(text))
+ % (
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)