From 7bb2a6c2a5c5e33ebf2c647a6e6a56ced6869cde Mon Sep 17 00:00:00 2001 From: JohnE Date: Wed, 10 Aug 2016 05:08:46 +0000 Subject: [PATCH] WIP --- exif_r.py | 3 +-- picseal.py | 66 +++++++++++++----------------------------------------- 2 files changed, 16 insertions(+), 53 deletions(-) mode change 100755 => 100644 exif_r.py diff --git a/exif_r.py b/exif_r.py old mode 100755 new mode 100644 index 29b1ee8..a3ed6ab --- a/exif_r.py +++ b/exif_r.py @@ -1,9 +1,8 @@ from gi.repository import GExiv2 -exif = GExiv2.Metadata('space.jpg') +exif = GExiv2.Metadata("space.jpg") print("*** *** *** *** *** *** ***") -print(exif) print(exif.get_date_time()) print ("*** *** *** *** *** *** ***") diff --git a/picseal.py b/picseal.py index 06156a6..aebd568 100644 --- a/picseal.py +++ b/picseal.py @@ -1,33 +1,25 @@ # # # +import os import argparse +import logging +from subprocess import Popen, PIPE, check_call + def main(): parseArgs() def parseArgs(): - print '***** ***** ***** *****' - print ' * Pic *** Seal *' - print '***** ***** ***** *****\n' - parser = argparse.ArgumentParser(description="Fingerprint a sqlite database based on its schema") - parser.add_argument('-db', '--database', required=False, help="path to file to be fingerprinted") - parser.add_argument('-fd', '--fpdir', required=False, help="path to directory of fingerprint files, compare each file") - parser.add_argument('-fp', '--fingerprint', required=False, help="fingerprint file to use in comparison") - parser.add_argument('-ad', '--android_dir', required=False, help="path to a directory with android folder structure sqlite files") - parser.add_argument('-dd', '--data_dir', required=False, help="path to a directory to search for sqlite files") - # parser.add_argument('-idx', '--index_fingerprints', required=False, help="path to a directory with sqlite files, index fingerprints if no other args given") - parser.add_argument('-an', '--app_name', required=False) - parser.add_argument('-av', '--app_version', required=False) - parser.add_argument('-n', '--notes', required=False) - parser.add_argument('-idx', action='store_true', help="add a fingerprint to the index") - parser.add_argument('-md5', required=False, help="md5 hash to query the index`") - parser.add_argument('-android_pull', action='store_true', help="automated pull of applications from a physical android phone") + print("***** ***** ***** *****") + print (" ** Pic * Seal ** ") + print("***** ***** ***** *****\n") + parser = argparse.ArgumentParser() + parser.add_argument('-i', '--image', required=False, help="source image file") parser.add_argument('-v', '--verbose', action='store_true', help="will set logging level to INFO") parser.add_argument('-vv', '--vverbose', action='store_true', help="will set logging level to DEBUG") parser.add_argument('-l', '--logging', action='store_true', help="will supercede the -v option and send all logging to a file, logging.DEBUG") - # parser.add_argument('-t', '--title', required=False) args = parser.parse_args() if (args.logging): @@ -39,41 +31,13 @@ def parseArgs(): logging.basicConfig(level=logging.DEBUG) else: logging.basicConfig(level=logging.CRITICAL) - - if args.fpdir and args.idx and (args.database or args.fingerprint): - insertFP(args.database, args.fingerprint, args.fpdir) - elif args.fpdir and args.idx: - indexFingerprints(args.fpdir) - elif (args.database and args.fingerprint): - compareFingerprint(args.database, args.fingerprint) - elif (args.fpdir and (args.database or args.fingerprint)): - compareFPIndex(args.fpdir, args.database, args.fingerprint) - elif (args.fpdir and args.md5): - queryMD5(args.fpdir, args.md5) - elif (args.android_dir): - androidData(args.android_dir) - elif (args.android_pull): - androidPull() - elif (args.database): - createFingerprint(args.database, args.app_name, args.app_version, args.notes) + + if (args.image): + pass else: - print 'Create fingerprint:' - print ' dbfp.py -db \n' - print 'Create fingerprint index:' - print ' dbfp.py -fd -idx\n' - print 'Add fingerprint to index:' - print ' dbfp.py -fp -idx (-db | -fp )\n' - print 'Compare fingerprint to a database file:' - print ' dbfp.py -fp -db \n' - print 'Lookup fingerprint from index:' - print ' dbfp.py -fd -fp )\n' - print 'Lookup database from index:' - print ' dbfp.py -fd -db \n' - print 'Lookup MD5 hash from index:' - print ' dbfp.py -fd -md5 \n' - print 'Android App pull and fingerprint:' - print ' dbfp.py -android_pull' - print '\n***** ***** ***** *****\n' + print('Create PicSeal images') + print(' picseal.py -i ') + print('\n***** ***** ***** *****\n') parser.print_help()