pre and p padding fixes
[dylansserver.git] / publish_projects.py
index da77e39..6e538d9 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/python
 
+PROJECTS_DIRECTORY = '/home/dylan/docs/projects'
+
 import os
 import time
 import MySQLdb as db
@@ -13,7 +15,7 @@ password = config.get('database', 'password').replace('"', '')
 database = config.get('database', 'database')
 cursor = db.connect(domain, user, password, database).cursor()
 
-notes = os.listdir('projects')
+notes = os.listdir(PROJECTS_DIRECTORY)
 
 sql = "SELECT title FROM projects"
 cursor.execute(sql)
@@ -24,7 +26,7 @@ for row in results:
 
 for note in notes:
     title = note[:note.index('.')]
-    f = open(os.path.join('projects', note))
+    f = open(os.path.join(PROJECTS_DIRECTORY, note))
     if title in existing_titles: continue
     text = f.read()
     cursor.execute("INSERT INTO projects (title, text)\