started work on partial import...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2012-03-20 01:39:22 +04:00
parent 2a4159b6d1
commit b08020313a
2 changed files with 30 additions and 2 deletions

4
gid.py
View File

@ -1,7 +1,7 @@
#=======================================================================
__version__ = '''0.0.01'''
__sub_version__ = '''20120316225150'''
__sub_version__ = '''20120317005456'''
__copyright__ = '''(c) Alex A. Naanou 2011'''
@ -23,6 +23,8 @@ import pyexiv2 as metadata
# XXX not yet sure if this is unique enough to avoid conflicts if one
# photographer has enough cameras...
# XXX also might be wise to add a photographer ID into here...
##!!! add gid info section to identify the options used to greate a gid, e.g. EXIF date vs. ctime, etc.
##!!! do a general revision and remove leacy...
def image_gid(path, date=None,
format='%(artist)s-%(date)s-%(name)s',
date_format='%Y%m%d-%H%M%S',

View File

@ -1,7 +1,7 @@
#=======================================================================
__version__ = '''0.0.01'''
__sub_version__ = '''20120317004325'''
__sub_version__ = '''20120320010842'''
__copyright__ = '''(c) Alex A. Naanou 2011'''
@ -41,10 +41,16 @@ config = json.load(open(CONFIG_NAME))
# XXX move this to a context-dependant module...
RAW = OR(
# Nikon
'NEF', 'nef',
# Panasonic/Leica
'RW2', 'rw2',
# Canon
'CRW', 'crw',
'CR2', 'cr2',
# Sigma
'X3F', 'x3f',
# Adobe/Leica
'DNG', 'dng',
)
@ -283,12 +289,32 @@ if __name__ == '__main__':
print 'loaded:', len(lst)
IMPORT_DIFF = False
# skip already read files...
if IMPORT_DIFF and not BUILD_FILE_LIST:
lst_cur = list(list_files(config['ARCHIVE_ROOT']))
print 'found files:', len(lst_cur)
lst_cur = [ e for e in lst_cur if e not in lst ]
print 'found new or updated files:', len(lst_cur)
lst = lst_cur
raise SystemExit
index = index_by_name(lst)
## GID_index = store.IndexWithCache(INDEX_PATH)
GID_index = store.Index(INDEX_PATH)
##!!! only check for updates...
GID_index, failed = gid_index(index, GID_index)
json.dump(failed, file(os.path.join('test', 'failed-to-categorise.json'), 'w'))