def _platform(*args):
 platform = '-'.join((x.strip() for x in filter(len, args)))
 platform = platform.replace(' ', '_')
 platform = platform.replace('/', '-')
 platform = platform.replace('\\', '-')
 platform = platform.replace(':', '-')
 platform = platform.replace(';', '-')
 platform = platform.replace('"', '-')
 platform = platform.replace('(', '-')
 platform = platform.replace(')', '-')
 platform = platform.replace('unknown', '')
 while 1:
  cleaned = platform.replace('--', '-')
  if (cleaned == platform):
   break
  platform = cleaned
 while (platform[(-1)] == '-'):
  platform = platform[:(-1)]
 return platform

def _platform ( * args ) : platform = '-' . join ( ( x . strip ( ) for x in filter ( len , args ) ) ) platform = platform . replace ( ' ' , '_' ) platform = platform . replace ( '/' , '-' ) platform = platform . replace ( '\\' , '-' ) platform = platform . replace ( ':' , '-' ) platform = platform . replace ( ';' , '-' ) platform = platform . replace ( '"' , '-' ) platform = platform . replace ( '(' , '-' ) platform = platform . replace ( ')' , '-' ) platform = platform . replace ( 'unknown' , '' ) while 1 : cleaned = platform . replace ( '--' , '-' ) if ( cleaned == platform ) : break platform = cleaned while ( platform [ ( - 1 ) ] == '-' ) : platform = platform [ : ( - 1 ) ] return platform
helper to format the platform string in a filename compatible format e .