def _extract_war_version(war):
 basename = os.path.basename(war)
 war_package = os.path.splitext(basename)[0]
 version = re.findall('-([\\d.-]+)$', war_package)
 return (version[0] if (version and (len(version) == 1)) else None)

def _extract_war_version ( war ) : basename = os . path . basename ( war ) war_package = os . path . splitext ( basename ) [ 0 ] version = re . findall ( '-([\\d.-]+)$' , war_package ) return ( version [ 0 ] if ( version and ( len ( version ) == 1 ) ) else None )
extract the version from the war file name .