def ResolveSubjectDestination(subject, regexes):
 components = Components(subject)
 if (not components):
  return ('aff4', '')
 path = utils.JoinPath(*[ConvertStringToFilename(x) for x in components])
 for route in regexes:
  m = route.match(path)
  if m:
   value = m.group('path')
   if value:
    base = os.path.basename(value)
    dirname = os.path.dirname(value)
    return (base, dirname)
 return ('aff4', '')

def ResolveSubjectDestination ( subject , regexes ) : components = Components ( subject ) if ( not components ) : return ( 'aff4' , '' ) path = utils . JoinPath ( * [ ConvertStringToFilename ( x ) for x in components ] ) for route in regexes : m = route . match ( path ) if m : value = m . group ( 'path' ) if value : base = os . path . basename ( value ) dirname = os . path . dirname ( value ) return ( base , dirname ) return ( 'aff4' , '' )
returns the directory/filename where the subject will be stored .