(zone)
return geo + '-' + coord + number + letter
Given a string that looks like a zone name, creates a shorter version.
Given a string that looks like a zone name, creates a shorter version.
Given a string that looks like a zone name creates a shorter version .
def ShortenZoneName(zone):
  """Given a string that looks like a zone name, creates a shorter version."""
  geo, coord, number, letter = re.findall(r'(\w+)-(\w+)(\d)-(\w)', zone)[0]
  geo = geo.lower() if len(geo) == 2 else default.LOC[geo.lower()]
  coord = default.LOC[coord.lower()]
  number = str(number)
  letter = letter.lower()
  return geo + '-' + coord + number + letter
def ShortenZoneName ( zone ) : geo , coord , number , letter = re . findall ( r'(\w+)-(\w+)(\d)-(\w)' , zone ) [ 0 ] geo = geo . lower ( ) if len ( geo ) == 2 else default . LOC [ geo . lower ( ) ] coord = default . LOC [ coord . lower ( ) ] number = str ( number ) letter = letter . lower ( ) return geo + '-' + coord + number + letter