mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
fixed a bug. and discovered that we effectively lost the actual extension of a file in the indexing process...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
fa3082cc96
commit
a419d706d7
19
index.py
19
index.py
@ -1,7 +1,7 @@
|
|||||||
#=======================================================================
|
#=======================================================================
|
||||||
|
|
||||||
__version__ = '''0.0.01'''
|
__version__ = '''0.0.01'''
|
||||||
__sub_version__ = '''20111110190116'''
|
__sub_version__ = '''20111110191552'''
|
||||||
__copyright__ = '''(c) Alex A. Naanou 2011'''
|
__copyright__ = '''(c) Alex A. Naanou 2011'''
|
||||||
|
|
||||||
|
|
||||||
@ -15,6 +15,8 @@ from itertools import izip, izip_longest
|
|||||||
|
|
||||||
from pli.logictypes import ANY, OR
|
from pli.logictypes import ANY, OR
|
||||||
|
|
||||||
|
from pprint import pprint
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
|
|
||||||
@ -187,21 +189,26 @@ def split_images(index):
|
|||||||
|
|
||||||
# prepare the return structure...
|
# prepare the return structure...
|
||||||
res = []
|
res = []
|
||||||
|
## pprint(raw)
|
||||||
for path in raw:
|
for path in raw:
|
||||||
##!!!
|
##!!!
|
||||||
res += [{
|
res += [{
|
||||||
'gid': uuid.uuid4(),
|
'gid': uuid.uuid4(),
|
||||||
'name': name,
|
'name': name,
|
||||||
## 'raw': [path],
|
'raw': [path],
|
||||||
}]
|
}]
|
||||||
# start splitting the data...
|
# start splitting the data...
|
||||||
for ext, paths in data.items():
|
for ext, paths in data.items():
|
||||||
# skip non-type fields...
|
# skip non-type fields...
|
||||||
if ext not in TYPES:
|
if ext not in TYPES:
|
||||||
continue
|
continue
|
||||||
|
if ext == 'raw':
|
||||||
|
continue
|
||||||
|
# start the work...
|
||||||
for path in paths:
|
for path in paths:
|
||||||
matches = []
|
matches = []
|
||||||
for i, c in enumerate(common):
|
for i, c in enumerate(common):
|
||||||
|
# use matching path head to match targets...
|
||||||
if path[:len(c)] == c:
|
if path[:len(c)] == c:
|
||||||
matches += [(len(c), i)]
|
matches += [(len(c), i)]
|
||||||
# multiple matches...
|
# multiple matches...
|
||||||
@ -220,13 +227,17 @@ def split_images(index):
|
|||||||
res[i][ext] = []
|
res[i][ext] = []
|
||||||
res[i][ext] += [path]
|
res[i][ext] += [path]
|
||||||
else:
|
else:
|
||||||
# XXX ungrouped...
|
##!!! XXX ungrouped files...
|
||||||
print '!!!!', path, name, ext
|
print '!!!!', path, name, ext
|
||||||
raise Exception, 'still got ungrouped files...'
|
raise Exception, 'still got ungrouped files...'
|
||||||
|
|
||||||
|
## print len(res)
|
||||||
|
## pprint(res)
|
||||||
|
## raise SystemExit
|
||||||
|
|
||||||
# yield the results...
|
# yield the results...
|
||||||
for e in res:
|
for e in res:
|
||||||
yield e['gid'], res
|
yield e['gid'], e
|
||||||
else:
|
else:
|
||||||
yield uuid.uuid4(), data
|
yield uuid.uuid4(), data
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user