def version_tag():
 names = version.NAMES.strip()
 assert (names[0] == '(')
 assert (names[(-1)] == ')')
 names = names[1:(-1)]
 l = [n.strip() for n in names.split(',')]
 for n in l:
  if (n.startswith('tag: ') and version_rx.match(n[5:])):
   return n[5:]
 return ('unknown-%s' % version.COMMIT[:7])

def version_tag ( ) : names = version . NAMES . strip ( ) assert ( names [ 0 ] == '(' ) assert ( names [ ( - 1 ) ] == ')' ) names = names [ 1 : ( - 1 ) ] l = [ n . strip ( ) for n in names . split ( ',' ) ] for n in l : if ( n . startswith ( 'tag: ' ) and version_rx . match ( n [ 5 : ] ) ) : return n [ 5 : ] return ( 'unknown-%s' % version . COMMIT [ : 7 ] )
format bups version tag .