def scourCoordinates(data, options, forceCommaWsp=False):
 if (data != None):
  newData = []
  c = 0
  previousCoord = ''
  for coord in data:
   scouredCoord = scourUnitlessLength(coord, needsRendererWorkaround=options.renderer_workaround)
   if ((c > 0) and (forceCommaWsp or scouredCoord[0].isdigit() or ((scouredCoord[0] == '.') and (not (('.' in previousCoord) or ('e' in previousCoord)))))):
    newData.append(' ')
   newData.append(scouredCoord)
   previousCoord = scouredCoord
   c += 1
  if options.renderer_workaround:
   if (len(newData) > 0):
    for i in xrange(1, len(newData)):
     if ((newData[i][0] == '-') and ('e' in newData[(i - 1)])):
      newData[(i - 1)] += ' '
    return ''.join(newData)
  else:
   return ''.join(newData)
 return ''

def scourCoordinates ( data , options , forceCommaWsp = False ) : if ( data != None ) : newData = [ ] c = 0 previousCoord = '' for coord in data : scouredCoord = scourUnitlessLength ( coord , needsRendererWorkaround = options . renderer_workaround ) if ( ( c > 0 ) and ( forceCommaWsp or scouredCoord [ 0 ] . isdigit ( ) or ( ( scouredCoord [ 0 ] == '.' ) and ( not ( ( '.' in previousCoord ) or ( 'e' in previousCoord ) ) ) ) ) ) : newData . append ( ' ' ) newData . append ( scouredCoord ) previousCoord = scouredCoord c += 1 if options . renderer_workaround : if ( len ( newData ) > 0 ) : for i in xrange ( 1 , len ( newData ) ) : if ( ( newData [ i ] [ 0 ] == '-' ) and ( 'e' in newData [ ( i - 1 ) ] ) ) : newData [ ( i - 1 ) ] += ' ' return '' . join ( newData ) else : return '' . join ( newData ) return ''
serializes coordinate data with some cleanups: - removes all trailing zeros after the decimal - integerize coordinates if possible - removes extraneous whitespace - adds spaces between values in a subcommand if required .