def pkgPath(root, path, rpath='/'):
 global data_files
 if (not os.path.exists(path)):
  return
 files = []
 for spath in os.listdir(path):
  if (spath == 'test'):
   continue
  subpath = os.path.join(path, spath)
  spath = os.path.join(rpath, spath)
  if os.path.isfile(subpath):
   files.append(subpath)
  if os.path.isdir(subpath):
   pkgPath(root, subpath, spath)
 data_files.append(((root + rpath), files))

def pkgPath ( root , path , rpath = '/' ) : global data_files if ( not os . path . exists ( path ) ) : return files = [ ] for spath in os . listdir ( path ) : if ( spath == 'test' ) : continue subpath = os . path . join ( path , spath ) spath = os . path . join ( rpath , spath ) if os . path . isfile ( subpath ) : files . append ( subpath ) if os . path . isdir ( subpath ) : pkgPath ( root , subpath , spath ) data_files . append ( ( ( root + rpath ) , files ) )
package up a path recursively .