This repository has been archived by the owner on Aug 4, 2021. It is now read-only.
/
example.py
63 lines (48 loc) · 1.94 KB
/
example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#! /usr/bin/python3.4
import sys, traceback
from ExifFolderTagger import ExifFolderTagger
from FolderCompare import FolderCompare
__author__ = 'hgv27681'
def doTagScan():
# use a try catch block so I can eat stderr and still see exceptions to stdout
# this is because we get lots of warnings about unknown exif folders from proprietary extensions
try:
tagger = ExifFolderTagger()
tagger.root_folder = '/mnt/E_DRIVE/PhotosWithTags/Pictures'
tagger.extensions_to_remove = [
'.db', '.ini', '.info', '.exe', '.url', '.tmp', '.thm',
'.rss', '.eml', '.rtf', '.dat', '.ivr', '.psd', '.jbf', '.mix', '.scn',
]
# also had these but they are part of record '.pdf', '.doc', '.wav', '.txt',
tagger.descriptions_to_ignore = [
'DCP', 'DIGITAL CAMERA', 'Camera',
]
tagger.folders_to_exclude = [
'2002/0101-bits and peices',
'2002/0405-Office not dated',
'2009/1106 Hair',
'2014/0106 Boyz',
'2014/1010 Hemdean Extension',
]
# the following 2 settings would switch to doing file renames only, and not use exif tags
#tagger.extensions_to_exif_tag = []
#tagger.extensions_to_rename.append('.jpg')
tagger.day_count_tolerance = 60
tagger.do_exif = True
tagger.do_write = True
tagger.set_dates_to_match_folder = True
# tagger.check_dates()
# tagger.report_dates()
tagger.tag_files()
tagger.report_tag()
except Exception as e:
print("Exception =", e)
traceback.print_exc(file=sys.stdout)
def doFolderScan():
try:
c = FolderCompare()
c.compare('/media/500GB\ Freecom/BigData/Pictures', '/media/500GB\ Freecom/BigData/Pictures')
except Exception as e:
print("Exception =", e)
traceback.print_exc(file=sys.stdout)
doFolderScan()