(*args)
return platform
Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
Helper to format the platform string in a filename compatible format e . g . system - version - machine .
def _platform(*args):

    """ Helper to format the platform string in a filename
        compatible format e.g. "system-version-machine".
    """
    # Format the platform string
    platform = '-'.join(x.strip() for x in filter(len, args))

    # Cleanup some possible filename obstacles...
    platform = platform.replace(' ', '_')
    platform = platform.replace('/', '-')
    platform = platform.replace('\\', '-')
    platform = platform.replace(':', '-')
    platform = platform.replace(';', '-')
    platform = platform.replace('"', '-')
    platform = platform.replace('(', '-')
    platform = platform.replace(')', '-')

    # No need to report 'unknown' information...
    platform = platform.replace('unknown', '')

    # Fold '--'s and remove trailing '-'
    while 1:
        cleaned = platform.replace('--', '-')
        if cleaned == platform:
            break
        platform = cleaned
    while platform[-1] == '-':
        platform = platform[:-1]

    return platform
def _platform ( * args ) : # Format the platform string platform = '-' . join ( x . strip ( ) for x in filter ( len , args ) ) # Cleanup some possible filename obstacles... platform = platform . replace ( ' ' , '_' ) platform = platform . replace ( '/' , '-' ) platform = platform . replace ( '\\' , '-' ) platform = platform . replace ( ':' , '-' ) platform = platform . replace ( ';' , '-' ) platform = platform . replace ( '"' , '-' ) platform = platform . replace ( '(' , '-' ) platform = platform . replace ( ')' , '-' ) # No need to report 'unknown' information... platform = platform . replace ( 'unknown' , '' ) # Fold '--'s and remove trailing '-' while 1 : cleaned = platform . replace ( '--' , '-' ) if cleaned == platform : break platform = cleaned while platform [ - 1 ] == '-' : platform = platform [ : - 1 ] return platform