PEATDB/Tables.py
def checkOSType(cls):
        """Check the OS we are in"""
        import os, string
        ostyp=''
        var_s=['OSTYPE','OS']
        for var in var_s:
            if os.environ.has_key(var):
                ostyp=string.lower(os.environ[var])

        ostyp=ostyp.lower()
        if ostyp.find('windows')!=-1:
            ostyp='windows'
        elif ostyp.find('darwin')!=-1 or ostyp.find('apple')!=-1:
            ostyp='mac'
        elif ostyp.find('linux')!=-1:
            ostyp='linux'
        else:
            ostyp='unknown'
            try:
                info=os.uname()
            except:
                pass
            ostyp=info[0].lower()
            if ostyp.find('darwin')!=-1:
                ostyp='mac'
        return ostyp
Check the OS we are in
Check the OS we are in
Check the OS we are in
def checkOSType(cls):
        import os, string
        ostyp=''
        var_s=['OSTYPE','OS']
        for var in var_s:
            if os.environ.has_key(var):
                ostyp=string.lower(os.environ[var])
        ostyp=ostyp.lower()
        if ostyp.find('windows')!=-1:
            ostyp='windows'
        elif ostyp.find('darwin')!=-1 or ostyp.find('apple')!=-1:
            ostyp='mac'
        elif ostyp.find('linux')!=-1:
            ostyp='linux'
        else:
            ostyp='unknown'
            try:
                info=os.uname()
            except:
                pass
            ostyp=info[0].lower()
            if ostyp.find('darwin')!=-1:
                ostyp='mac'
        return ostyp
def checkOSType ( cls ) : import os , string ostyp = '' var_s = [ 'OSTYPE' , 'OS' ] for var in var_s : if os . environ . has_key ( var ) : ostyp = string . lower ( os . environ [ var ] ) ostyp = ostyp . lower ( ) if ostyp . find ( 'windows' ) != - 1 : ostyp = 'windows' elif ostyp . find ( 'darwin' ) != - 1 or ostyp . find ( 'apple' ) != - 1 : ostyp = 'mac' elif ostyp . find ( 'linux' ) != - 1 : ostyp = 'linux' else : ostyp = 'unknown' try : info = os . uname ( ) except : pass ostyp = info [ 0 ] . lower ( ) if ostyp . find ( 'darwin' ) != - 1 : ostyp = 'mac' return ostyp
Check the OS we are in
Check the OS we are in
"""Check the OS we are in"""
cls