From: Dylan Lloyd Date: Fri, 25 Mar 2011 02:40:28 +0000 (-0400) Subject: Fixed error when .swp files in /notes or /projects X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=7e4f42439c5e121d0c5647d282d6e4477e2696d1;p=dylansserver.git Fixed error when .swp files in /notes or /projects --- diff --git a/publish_notes.py b/publish_notes.py index 2f99dc6..331030c 100755 --- a/publish_notes.py +++ b/publish_notes.py @@ -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)) diff --git a/publish_projects.py b/publish_projects.py index 6e538d9..14a5772 100755 --- a/publish_projects.py +++ b/publish_projects.py @@ -25,9 +25,10 @@ for row in results: existing_titles.append(row[0]) for note in notes: + if (note[:1] == '.'): continue title = note[:note.index('.')] f = open(os.path.join(PROJECTS_DIRECTORY, note)) if title in existing_titles: continue text = f.read() cursor.execute("INSERT INTO projects (title, text)\ - VALUES (%s, %s)", (title, text)) + VALUES (%s, %s)", (title, text))