First bits of renderer code
parent
c53c8a4f16
commit
9a61bf5456
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
import os, argparse, hashlib, sqlite3, time
|
||||
|
||||
parser = argparse.ArgumentParser(description='Renders static HTML pages and indexes from an SQLite database of emails and an attachment folder.')
|
||||
|
||||
parser.add_argument('-d', dest='database', action='store', default='emails.db',
|
||||
help='path of the database that should be used to render the e-mail files')
|
||||
|
||||
parser.add_argument('-a', dest='attachment_dir', action='store', default='attachments',
|
||||
help='path where attachments are stored')
|
||||
|
||||
args = parser.parse_args()
|
||||
options = vars(args)
|
||||
|
||||
# Connect to database
|
||||
database = sqlite3.connect(options['database'])
|
||||
cursor = database.cursor()
|
||||
|
||||
cursor.execute("SELECT * FROM emails")
|
||||
email_list = cursor.fetchall()
|
||||
|
||||
print email_list
|
Loading…
Reference in New Issue