Permalink
Browse files

look for IDs also within filename

  • Loading branch information...
graik committed Jan 10, 2017
1 parent 9a713c8 commit a791e38950676a8509ea33d68bc6ee92cf62ba9b
Showing with 7 additions and 0 deletions.
  1. +7 −0 rotmic/forms/uploadForms.py
@@ -193,6 +193,13 @@ def _findsample(self, fname, sdic):
if searchfrags in sdic:
return sdic[searchfrags]
## look harder; now also check internal occurences of ID(s)
for i in range(0,len(frags)-n_fields+1):
if i < len(frags):
searchfrags = tuple(frags[i:i+n_fields]) ## any 1 or 2 fragments
if searchfrags in sdic:
return sdic[searchfrags]
self.add_error('files',\
'Cannot match %s to any of the samples.' % fname +\
'No sample can be identified by %s.' % ' + '.join(searchfrags) )

0 comments on commit a791e38

Please sign in to comment.