8 config
= ConfigParser
.RawConfigParser()
9 config
.read('/etc/dylanstestserver.ini')
10 domain
= config
.get('database', 'domain')
11 user
= config
.get('database', 'user')
12 password
= config
.get('database', 'password').replace('"', '')
13 database
= config
.get('database', 'database')
14 print domain
, user
, password
, database
15 cursor
= db
.connect(domain
, user
, password
, database
).cursor()
17 notes
= os
.listdir('projects')
19 sql
= "SELECT title FROM projects"
21 results
= cursor
.fetchall()
24 existing_titles
.append(row
[0])
27 title
= note
[:note
.index('.')]
28 f
= open(os
.path
.join('projects', note
))
29 if title
in existing_titles
: continue
31 cursor
.execute("INSERT INTO projects (title, text)\
32 VALUES (%s, %s)", (title
, text
))