def get_theme_bundles(themes):
 bundles = {}
 for theme_name in themes:
  bundles_path = os.path.join(utils.get_theme_path(theme_name), u'bundles')
  if os.path.isfile(bundles_path):
   with open(bundles_path) as fd:
    for line in fd:
     try:
      (name, files) = line.split(u'=')
      files = [f.strip() for f in files.split(u',')]
      bundles[name.strip().replace(u'/', os.sep)] = files
     except ValueError:
      pass
    break
 return bundles

def get_theme_bundles ( themes ) : bundles = { } for theme_name in themes : bundles_path = os . path . join ( utils . get_theme_path ( theme_name ) , u'bundles' ) if os . path . isfile ( bundles_path ) : with open ( bundles_path ) as fd : for line in fd : try : ( name , files ) = line . split ( u'=' ) files = [ f . strip ( ) for f in files . split ( u',' ) ] bundles [ name . strip ( ) . replace ( u'/' , os . sep ) ] = files except ValueError : pass break return bundles
given a theme chain .