本文整理汇总了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':
#.........这里部分代码省略.........
示例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
示例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":
#.........这里部分代码省略.........
示例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
示例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,
#.........这里部分代码省略.........