Restructuring
This commit is contained in:
parent
9a61bf5456
commit
2424989fa0
11
render
11
render
|
@ -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…
Reference in a new issue