def getInitVersion(pkgroot):
 path = os.getcwd()
 initfile = os.path.join(path, pkgroot, '__init__.py')
 init = open(initfile).read()
 m = re.search('__version__ = (\\S+)\\n', init)
 if ((m is None) or (len(m.groups()) != 1)):
  raise Exception(("Cannot determine __version__ from init file: '%s'!" % initfile))
 version = m.group(1).strip('\'"')
 return version

def getInitVersion ( pkgroot ) : path = os . getcwd ( ) initfile = os . path . join ( path , pkgroot , '__init__.py' ) init = open ( initfile ) . read ( ) m = re . search ( '__version__ = (\\S+)\\n' , init ) if ( ( m is None ) or ( len ( m . groups ( ) ) != 1 ) ) : raise Exception ( ( "Cannot determine __version__ from init file: '%s'!" % initfile ) ) version = m . group ( 1 ) . strip ( '\'"' ) return version
return the version string defined in __init__ .