Restructuring

master
Sven Slootweg 13 years ago
parent 9a61bf5456
commit 2424989fa0

@ -13,11 +13,14 @@ parser.add_argument('-a', dest='attachment_dir', action='store', default='attach
args = parser.parse_args()
options = vars(args)
if os.path.isfile(options['database']) == False:
print "Database file not found. Use the -d switch to specify a custom database path."
exit(1)
# Connect to database
database = sqlite3.connect(options['database'])
cursor = database.cursor()
cursor.execute("SELECT * FROM emails")
email_list = cursor.fetchall()
print email_list
for message in cursor.execute("SELECT * FROM emails"):
message_id, sender, recipient, subject, timestamp, textbody, htmlbody, sha1_hash = message

Loading…
Cancel
Save