def name_to_cat(fname, cat=None):
 if ((cat is None) and fname.startswith('{{')):
  n = fname.find('}}')
  if (n > 2):
   cat = fname[2:n].strip()
   fname = fname[(n + 2):].strip()
   logging.debug('Job %s has category %s', fname, cat)
 return (fname, cat)

def name_to_cat ( fname , cat = None ) : if ( ( cat is None ) and fname . startswith ( '{{' ) ) : n = fname . find ( '}}' ) if ( n > 2 ) : cat = fname [ 2 : n ] . strip ( ) fname = fname [ ( n + 2 ) : ] . strip ( ) logging . debug ( 'Job %s has category %s' , fname , cat ) return ( fname , cat )
retrieve category from file name .