当前位置: 首页>>代码示例>>Python>>正文


Python vms_lib.getsyi函数代码示例

本文整理汇总了Python中vms_lib.getsyi函数的典型用法代码示例。如果您正苦于以下问题:Python getsyi函数的具体用法?Python getsyi怎么用?Python getsyi使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getsyi函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: uname

def uname():

    """ Fairly portable uname interface. Returns a tuple
        of strings (system,node,release,version,machine,processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    """
    global _uname_cache

    if _uname_cache is not None:
        return _uname_cache

    # Get some infos from the builtin os.uname API...
    try:
        system,node,release,version,machine = os.uname()

    except AttributeError:
        # Hmm, no uname... we'll have to poke around the system then.
        system = sys.platform
        release = ''
        version = ''
        node = _node()
        machine = ''
        processor = ''
        use_syscmd_ver = 1

        # Try win32_ver() on win32 platforms
        if system == 'win32':
            release,version,csd,ptype = win32_ver()
            if release and version:
                use_syscmd_ver = 0

        # Try the 'ver' system command available on some
        # platforms
        if use_syscmd_ver:
            system,release,version = _syscmd_ver(system)
            # Normalize system to what win32_ver() normally returns
            # (_syscmd_ver() tends to return the vendor name as well)
            if system == 'Microsoft Windows':
                system = 'Windows'

        # In case we still don't know anything useful, we'll try to
        # help ourselves
        if system in ('win32','win16'):
            if not version:
                if system == 'win32':
                    version = '32bit'
                else:
                    version = '16bit'
            system = 'Windows'

        elif system[:4] == 'java':
            release,vendor,vminfo,osinfo = java_ver()
            system = 'Java'
            version = string.join(vminfo,', ')
            if not version:
                version = vendor

        elif os.name == 'mac':
            release,(version,stage,nonrel),machine = mac_ver()
            system = 'MacOS'

    else:
        # System specific extensions
        if system == 'OpenVMS':
            # OpenVMS seems to have release and version mixed up
            if not release or release == '0':
                release = version
                version = ''
            # Get processor information
            try:
                import vms_lib
            except ImportError:
                pass
            else:
                csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0)
                if (cpu_number >= 128):
                    processor = 'Alpha'
                else:
                    processor = 'VAX'
        else:
            # Get processor information from the uname system command
            processor = _syscmd_uname('-p','')

    # 'unknown' is not really any useful as information; we'll convert
    # it to '' which is more portable
    if system == 'unknown':
        system = ''
    if node == 'unknown':
        node = ''
    if release == 'unknown':
        release = ''
    if version == 'unknown':
        version = ''
    if machine == 'unknown':
#.........这里部分代码省略.........
开发者ID:ShedoSurashu,项目名称:TideSDK-Runtime,代码行数:101,代码来源:platform.py

示例2: uname

def uname():
    global _uname_cache
    no_os_uname = 0
    if _uname_cache is not None:
        return _uname_cache
    processor = ''
    try:
        (system, node, release, version, machine) = os.uname()
    except AttributeError:
        no_os_uname = 1
    if no_os_uname or not list(filter(None, (system, node, release, version, machine))):
        if no_os_uname:
            system = sys.platform
            release = ''
            version = ''
            node = _node()
            machine = ''
        use_syscmd_ver = 1
        if system == 'win32':
            (release, version, csd, ptype) = win32_ver()
            if release and version:
                use_syscmd_ver = 0
            if not machine:
                if 'PROCESSOR_ARCHITEW6432' in os.environ:
                    machine = os.environ.get('PROCESSOR_ARCHITEW6432', '')
                else:
                    machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
            if not processor:
                processor = os.environ.get('PROCESSOR_IDENTIFIER', machine)
        if use_syscmd_ver:
            (system, release, version) = _syscmd_ver(system)
            if system == 'Microsoft Windows':
                system = 'Windows'
            elif system == 'Microsoft' and release == 'Windows':
                system = 'Windows'
                if '6.0' == version[:3]:
                    release = 'Vista'
                else:
                    release = ''
        if system in ('win32', 'win16'):
            if not version:
                if system == 'win32':
                    version = '32bit'
                else:
                    version = '16bit'
            system = 'Windows'
        elif system[:4] == 'java':
            (release, vendor, vminfo, osinfo) = java_ver()
            system = 'Java'
            version = ', '.join(vminfo)
            if not version:
                version = vendor
    if system == 'OpenVMS':
        if not release or release == '0':
            release = version
            version = ''
        try:
            import vms_lib
        except ImportError:
            pass
        (csid, cpu_number) = vms_lib.getsyi('SYI$_CPU', 0)
        if cpu_number >= 128:
            processor = 'Alpha'
        else:
            processor = 'VAX'
    if not processor:
        processor = _syscmd_uname('-p', '')
    if system == 'unknown':
        system = ''
    if node == 'unknown':
        node = ''
    if release == 'unknown':
        release = ''
    if version == 'unknown':
        version = ''
    if machine == 'unknown':
        machine = ''
    if processor == 'unknown':
        processor = ''
    if system == 'Microsoft' and release == 'Windows':
        system = 'Windows'
        release = 'Vista'
    _uname_cache = uname_result(system, node, release, version, machine, processor)
    return _uname_cache
开发者ID:johndpope,项目名称:sims4-ai-engine,代码行数:84,代码来源:platform.py

示例3: uname

def uname():

    """ Fairly portable uname interface. Returns a tuple
        of strings (system,node,release,version,machine,processor)
        identifying the underlying platform.

        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.

        Entries which cannot be determined are set to ''.

    """
    global _uname_cache

    if _uname_cache is not None:
        return _uname_cache

    # Get some infos from the builtin os.uname API...
    try:
        system, node, release, version, machine = os.uname()

    except AttributeError:
        # Hmm, no uname... we'll have to poke around the system then.
        system = sys.platform
        release = ""
        version = ""
        node = _node()
        machine = ""
        processor = ""
        use_syscmd_ver = 1

        # Try win32_ver() on win32 platforms
        if system == "win32":
            release, version, csd, ptype = win32_ver()
            if release and version:
                use_syscmd_ver = 0

        # Try the 'ver' system command available on some
        # platforms
        if use_syscmd_ver:
            system, release, version = _syscmd_ver(system)
            # Normalize system to what win32_ver() normally returns
            # (_syscmd_ver() tends to return the vendor name as well)
            if system == "Microsoft Windows":
                system = "Windows"

        # In case we still don't know anything useful, we'll try to
        # help ourselves
        if system in ("win32", "win16"):
            if not version:
                if system == "win32":
                    version = "32bit"
                else:
                    version = "16bit"
            system = "Windows"

        elif system[:4] == "java":
            release, vendor, vminfo, osinfo = java_ver()
            system = "Java"
            version = string.join(vminfo, ", ")
            if not version:
                version = vendor

        elif os.name == "mac":
            release, (version, stage, nonrel), machine = mac_ver()
            system = "MacOS"

    else:
        # System specific extensions
        if system == "OpenVMS":
            # OpenVMS seems to have release and version mixed up
            if not release or release == "0":
                release = version
                version = ""
            # Get processor information
            try:
                import vms_lib
            except ImportError:
                pass
            else:
                csid, cpu_number = vms_lib.getsyi("SYI$_CPU", 0)
                if cpu_number >= 128:
                    processor = "Alpha"
                else:
                    processor = "VAX"
        else:
            # Get processor information from the uname system command
            processor = _syscmd_uname("-p", "")

    # 'unknown' is not really any useful as information; we'll convert
    # it to '' which is more portable
    if system == "unknown":
        system = ""
    if node == "unknown":
        node = ""
    if release == "unknown":
        release = ""
    if version == "unknown":
        version = ""
    if machine == "unknown":
#.........这里部分代码省略.........
开发者ID:alkorzt,项目名称:pypy,代码行数:101,代码来源:platform.py

示例4: uname


#.........这里部分代码省略.........

        use_syscmd_ver = 1

        # Try win32_ver() on win32 platforms
        if system == 'win32':
            release, version, csd, ptype = win32_ver()
            if release and version:
                use_syscmd_ver = 0
            # Try to use the PROCESSOR_* environment variables
            # available on Win XP and later; see
            # http://support.microsoft.com/kb/888731 and
            # http://www.geocities.com/rick_lively/MANUALS/ENV/MSWIN/PROCESSI.HTM
            if not machine:
                # WOW64 processes mask the native architecture
                if "PROCESSOR_ARCHITEW6432" in os.environ:
                    machine = os.environ.get("PROCESSOR_ARCHITEW6432", '')
                else:
                    machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
            if not processor:
                processor = os.environ.get('PROCESSOR_IDENTIFIER', machine)

        # Try the 'ver' system command available on some
        # platforms
        if use_syscmd_ver:
            system, release, version = _syscmd_ver(system)
            # Normalize system to what win32_ver() normally returns
            # (_syscmd_ver() tends to return the vendor name as well)
            if system == 'Microsoft Windows':
                system = 'Windows'
            elif system == 'Microsoft' and release == 'Windows':
                # Under Windows Vista and Windows Server 2008,
                # Microsoft changed the output of the ver command. The
                # release is no longer printed.  This causes the
                # system and release to be misidentified.
                system = 'Windows'
                if '6.0' == version[:3]:
                    release = 'Vista'
                else:
                    release = ''

        # In case we still don't know anything useful, we'll try to
        # help ourselves
        if system in ('win32', 'win16'):
            if not version:
                if system == 'win32':
                    version = '32bit'
                else:
                    version = '16bit'
            system = 'Windows'

        elif system[:4] == 'java':
            release, vendor, vminfo, osinfo = java_ver()
            system = 'Java'
            version = ', '.join(vminfo)
            if not version:
                version = vendor

    # System specific extensions
    if system == 'OpenVMS':
        # OpenVMS seems to have release and version mixed up
        if not release or release == '0':
            release = version
            version = ''
        # Get processor information
        try:
            import vms_lib
        except ImportError:
            pass
        else:
            csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0)
            if (cpu_number >= 128):
                processor = 'Alpha'
            else:
                processor = 'VAX'
    if not processor:
        # Get processor information from the uname system command
        processor = _syscmd_uname('-p', '')

    #If any unknowns still exist, replace them with ''s, which are more portable
    if system == 'unknown':
        system = ''
    if node == 'unknown':
        node = ''
    if release == 'unknown':
        release = ''
    if version == 'unknown':
        version = ''
    if machine == 'unknown':
        machine = ''
    if processor == 'unknown':
        processor = ''

    #  normalize name
    if system == 'Microsoft' and release == 'Windows':
        system = 'Windows'
        release = 'Vista'

    _uname_cache = uname_result(system, node, release, version,
                                machine, processor)
    return _uname_cache
开发者ID:maplescene,项目名称:kbengine,代码行数:101,代码来源:platform.py

示例5: uname

def uname():
    """ Fairly portable uname interface. Returns a tuple
        of strings (system,node,release,version,machine,processor)
        identifying the underlying platform.
    
        Note that unlike the os.uname function this also returns
        possible processor information as an additional tuple entry.
    
        Entries which cannot be determined are set to ''.
    
    """
    global _uname_cache
    no_os_uname = 0
    if _uname_cache is not None:
        return _uname_cache
    else:
        processor = ''
        try:
            system, node, release, version, machine = os.uname()
        except AttributeError:
            no_os_uname = 1

        if no_os_uname or not filter(None, (system,
         node,
         release,
         version,
         machine)):
            if no_os_uname:
                system = sys.platform
                release = ''
                version = ''
                node = _node()
                machine = ''
            use_syscmd_ver = 1
            if system == 'win32':
                release, version, csd, ptype = win32_ver()
                if release and version:
                    use_syscmd_ver = 0
                if not machine:
                    if 'PROCESSOR_ARCHITEW6432' in os.environ:
                        machine = os.environ.get('PROCESSOR_ARCHITEW6432', '')
                    else:
                        machine = os.environ.get('PROCESSOR_ARCHITECTURE', '')
                if not processor:
                    processor = os.environ.get('PROCESSOR_IDENTIFIER', machine)
            if use_syscmd_ver:
                system, release, version = _syscmd_ver(system)
                if system == 'Microsoft Windows':
                    system = 'Windows'
                elif system == 'Microsoft' and release == 'Windows':
                    system = 'Windows'
                    if '6.0' == version[:3]:
                        release = 'Vista'
                    else:
                        release = ''
            if system in ('win32', 'win16'):
                if not version:
                    if system == 'win32':
                        version = '32bit'
                    else:
                        version = '16bit'
                system = 'Windows'
            elif system[:4] == 'java':
                release, vendor, vminfo, osinfo = java_ver()
                system = 'Java'
                version = string.join(vminfo, ', ')
                if not version:
                    version = vendor
        if system == 'OpenVMS':
            if not release or release == '0':
                release = version
                version = ''
            try:
                import vms_lib
            except ImportError:
                pass
            else:
                csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0)
                if cpu_number >= 128:
                    processor = 'Alpha'
                else:
                    processor = 'VAX'
        if not processor:
            processor = _syscmd_uname('-p', '')
        if system == 'unknown':
            system = ''
        if node == 'unknown':
            node = ''
        if release == 'unknown':
            release = ''
        if version == 'unknown':
            version = ''
        if machine == 'unknown':
            machine = ''
        if processor == 'unknown':
            processor = ''
        if system == 'Microsoft' and release == 'Windows':
            system = 'Windows'
            release = 'Vista'
        _uname_cache = (system,
#.........这里部分代码省略.........
开发者ID:webiumsk,项目名称:WOT-0.9.14-CT,代码行数:101,代码来源:platform.py


注:本文中的vms_lib.getsyi函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。