def str_version_to_evr(verstring):
 if (verstring in [None, '']):
  return ('0', '', '')
 idx_e = verstring.find(':')
 if (idx_e != (-1)):
  try:
   epoch = str(int(verstring[:idx_e]))
  except ValueError:
   epoch = '0'
 else:
  epoch = '0'
 idx_r = verstring.find('-')
 if (idx_r != (-1)):
  version = verstring[(idx_e + 1):idx_r]
  release = verstring[(idx_r + 1):]
 else:
  version = verstring[(idx_e + 1):]
  release = ''
 return (epoch, version, release)

def str_version_to_evr ( verstring ) : if ( verstring in [ None , '' ] ) : return ( '0' , '' , '' ) idx_e = verstring . find ( ':' ) if ( idx_e != ( - 1 ) ) : try : epoch = str ( int ( verstring [ : idx_e ] ) ) except ValueError : epoch = '0' else : epoch = '0' idx_r = verstring . find ( '-' ) if ( idx_r != ( - 1 ) ) : version = verstring [ ( idx_e + 1 ) : idx_r ] release = verstring [ ( idx_r + 1 ) : ] else : version = verstring [ ( idx_e + 1 ) : ] release = '' return ( epoch , version , release )
split the package version string into epoch .