mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
started work on partial import...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
2a4159b6d1
commit
b08020313a
4
gid.py
4
gid.py
@ -1,7 +1,7 @@
|
|||||||
#=======================================================================
|
#=======================================================================
|
||||||
|
|
||||||
__version__ = '''0.0.01'''
|
__version__ = '''0.0.01'''
|
||||||
__sub_version__ = '''20120316225150'''
|
__sub_version__ = '''20120317005456'''
|
||||||
__copyright__ = '''(c) Alex A. Naanou 2011'''
|
__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
|
# XXX not yet sure if this is unique enough to avoid conflicts if one
|
||||||
# photographer has enough cameras...
|
# photographer has enough cameras...
|
||||||
# XXX also might be wise to add a photographer ID into here...
|
# 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,
|
def image_gid(path, date=None,
|
||||||
format='%(artist)s-%(date)s-%(name)s',
|
format='%(artist)s-%(date)s-%(name)s',
|
||||||
date_format='%Y%m%d-%H%M%S',
|
date_format='%Y%m%d-%H%M%S',
|
||||||
|
|||||||
28
index2.py
28
index2.py
@ -1,7 +1,7 @@
|
|||||||
#=======================================================================
|
#=======================================================================
|
||||||
|
|
||||||
__version__ = '''0.0.01'''
|
__version__ = '''0.0.01'''
|
||||||
__sub_version__ = '''20120317004325'''
|
__sub_version__ = '''20120320010842'''
|
||||||
__copyright__ = '''(c) Alex A. Naanou 2011'''
|
__copyright__ = '''(c) Alex A. Naanou 2011'''
|
||||||
|
|
||||||
|
|
||||||
@ -41,10 +41,16 @@ config = json.load(open(CONFIG_NAME))
|
|||||||
|
|
||||||
# XXX move this to a context-dependant module...
|
# XXX move this to a context-dependant module...
|
||||||
RAW = OR(
|
RAW = OR(
|
||||||
|
# Nikon
|
||||||
'NEF', 'nef',
|
'NEF', 'nef',
|
||||||
|
# Panasonic/Leica
|
||||||
|
'RW2', 'rw2',
|
||||||
|
# Canon
|
||||||
'CRW', 'crw',
|
'CRW', 'crw',
|
||||||
'CR2', 'cr2',
|
'CR2', 'cr2',
|
||||||
|
# Sigma
|
||||||
'X3F', 'x3f',
|
'X3F', 'x3f',
|
||||||
|
# Adobe/Leica
|
||||||
'DNG', 'dng',
|
'DNG', 'dng',
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -283,12 +289,32 @@ if __name__ == '__main__':
|
|||||||
print 'loaded:', len(lst)
|
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)
|
index = index_by_name(lst)
|
||||||
|
|
||||||
|
|
||||||
## GID_index = store.IndexWithCache(INDEX_PATH)
|
## GID_index = store.IndexWithCache(INDEX_PATH)
|
||||||
GID_index = store.Index(INDEX_PATH)
|
GID_index = store.Index(INDEX_PATH)
|
||||||
|
|
||||||
|
##!!! only check for updates...
|
||||||
|
|
||||||
GID_index, failed = gid_index(index, GID_index)
|
GID_index, failed = gid_index(index, GID_index)
|
||||||
|
|
||||||
json.dump(failed, file(os.path.join('test', 'failed-to-categorise.json'), 'w'))
|
json.dump(failed, file(os.path.join('test', 'failed-to-categorise.json'), 'w'))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user