⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sysinfo.py

📁 linux下的一款播放器
💻 PY
📖 第 1 页 / 共 3 页
字号:
# # ***** BEGIN LICENSE BLOCK *****# Source last modified: $Id: sysinfo.py,v 1.60 2004/12/08 22:34:30 pankajgupta Exp $# # Portions Copyright (c) 1995-2004 RealNetworks, Inc. All Rights Reserved.# # The contents of this file, and the files included with this file,# are subject to the current version of the RealNetworks Public# Source License (the "RPSL") available at# http://www.helixcommunity.org/content/rpsl unless you have licensed# the file under the current version of the RealNetworks Community# Source License (the "RCSL") available at# http://www.helixcommunity.org/content/rcsl, in which case the RCSL# will apply. You may also obtain the license terms directly from# RealNetworks.  You may not use this file except in compliance with# the RPSL or, if you have a valid RCSL with RealNetworks applicable# to this file, the RCSL.  Please see the applicable RPSL or RCSL for# the rights, obligations and limitations governing use of the# contents of the file.# # Alternatively, the contents of this file may be used under the# terms of the GNU General Public License Version 2 or later (the# "GPL") in which case the provisions of the GPL are applicable# instead of those above. If you wish to allow use of your version of# this file only under the terms of the GPL, and not to allow others# to use your version of this file under the terms of either the RPSL# or RCSL, indicate your decision by deleting the provisions above# and replace them with the notice and other provisions required by# the GPL. If you do not delete the provisions above, a recipient may# use your version of this file under the terms of any one of the# RPSL, the RCSL or the GPL.# # This file is part of the Helix DNA Technology. RealNetworks is the# developer of the Original Code and owns the copyrights in the# portions it created.# # This file, and the files included with this file, is distributed# and made available on an 'AS IS' basis, WITHOUT WARRANTY OF ANY# KIND, EITHER EXPRESS OR IMPLIED, AND REALNETWORKS HEREBY DISCLAIMS# ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES# OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET# ENJOYMENT OR NON-INFRINGEMENT.# # Technology Compatibility Kit Test Suite(s) Location:#    http://www.helixcommunity.org/content/tck# # Contributor(s):# # ***** END LICENSE BLOCK *****# """System type dection module."""import sysimport osimport stringimport err## description of supported archatecturesARCH_HASH = {    'alpha'    : 'Digital Alpha Processor',    'i386'     : 'Intel x86',    'powerpc'  : 'Motarola PowerPC',    'arm'      : 'StrongARM',    'sparc'    : 'Sun Sparc/UltraSparc',    'm68k'     : 'Motarola 68k',    'sh4'      : 'SH4',    'parisc'   : 'HP PA/RISC Processor',    'ia64'     : 'Intel IA64',    'mips'     : 'MIPS',    'tm1'      : 'TriMedia 1300',    }PLATFORM_HASH = {}def AddPlatform(platform):    global PLATFORM_HASH    PLATFORM_HASH[platform.id] = platformclass Platform:    def __init__(self,                 id,                 platform,                 arch,                 distribution_id,                 family_list,                 host_type = None):        self.id = id        self.platform = platform        self.arch = arch        self.family_list = family_list        self.distribution_id = distribution_id        if host_type:            self.host_type=host_type        else:            if platform in ['win32', 'mac']:                self.host_type=platform            elif 'win' in family_list:                self.host_type='win32'            elif 'unix' in family_list:                self.host_type='posix'            else:                print "Warning, unable to guess host type for %s" % id            ## define all platformsAddPlatform(Platform(    id = 'aix-4.2-powerpc',    platform = 'aix4',    arch = 'powerpc',    distribution_id = 'aix-4.2-powerpc',    family_list = ['unix', 'aix4', 'aix-4.2'] ))AddPlatform(Platform(    id = 'aix-4.3-powerpc',    platform = 'aix4',    arch = 'powerpc',    distribution_id = 'aix-4.3-powerpc',    family_list = ['unix', 'aix4', 'aix-4.3'] ))AddPlatform(Platform(    id = 'beos-4.5-i386',    platform = 'beos',    arch = 'i386',    distribution_id = 'beos-4.5-i386',    family_list = ['unix', 'beos', 'beos-4.5'] ))AddPlatform(Platform(    id = 'freebsd-2.2-i386',    platform = 'freebsd2',    arch = 'i386',    distribution_id = 'freebsd-2.2-i386',    family_list = ['unix', 'freebsd', 'freebsd2', 'freebsd-2.2'] ))AddPlatform(Platform(    id = 'freebsd-3.0-i386',    platform = 'freebsd3',    arch = 'i386',    distribution_id = 'freebsd-3.0-i386',    family_list = ['unix', 'freebsd', 'freebsd3', 'freebsd-3.0'] ))AddPlatform(Platform(    id = 'freebsd-4.0-i386',    platform = 'freebsd4',    arch = 'i386',    distribution_id = 'freebsd-4.0-i386',    family_list = ['unix', 'freebsd', 'freebsd4', 'freebsd-4.0'] ))AddPlatform(Platform(    id = 'freebsd-4.0-i586',    platform = 'freebsd4',    arch = 'i386',    distribution_id = 'freebsd-4.0-i386',    family_list = ['unix', 'freebsd', 'freebsd4', 'freebsd-4.0', 'freebsd-4.0-i586'] ))AddPlatform(Platform(    id = 'freebsd-5.0-i586',    platform = 'freebsd5',    arch = 'i386',    distribution_id = 'freebsd-5.0-i586',    family_list = ['unix', 'freebsd', 'freebsd5', 'freebsd-5.0', 'freebsd-5.0-i586'] ))AddPlatform(Platform(    id = 'openbsd-3.3-i586',    platform = 'openbsd33',    arch = 'i386',    distribution_id = 'openbsd-3.3-i586',    family_list = ['unix', 'openbsd', 'openbsd3', 'openbsd-3.3', 'openbsd-3.3-i586'] ))AddPlatform(Platform(    id = 'hpux-11.0-parisc',    platform = 'hp-uxB',    arch = 'parisc',    distribution_id = 'hpux-11.0-parisc',    family_list = ['unix', 'hp-uxB', 'hpux-11.0'] ))AddPlatform(Platform(    id = 'hpux-11.0-ia64',    platform = 'hp-uxB',    arch = 'ia64',    distribution_id = 'hpux-11.0-ia64',    family_list = ['unix', 'hp-uxB', 'hpux-11.0', 'hpux-11.0-ia64'] ))AddPlatform(Platform(    id = 'linux-2.0-libc6-mips-ps2',    platform = 'linux2',    arch = 'mips',    distribution_id = 'linux-2.0-libc6-mips-ps2',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'ps2linux'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-iwmmxt-xscale',    platform = 'linux2',    arch = 'arm',    distribution_id = 'linux-2.2-libc6-armv5te-gcc3.3-iwmmxt-softfloat',    family_list = ['unix', 'linux', 'linux2','gcc3', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-libc6-xscale'] ))AddPlatform(Platform(    id = 'irix-6.2-mips',    platform = 'irix6',    arch = 'mips',    distribution_id = 'irix-6.2-mips',    family_list = ['unix', 'irix', 'irix6', 'irix-6.2'] ))AddPlatform(Platform(    id = 'irix-6.3-mips',    platform = 'irix6',    arch = 'mips',    distribution_id = 'irix-6.3-mips',    family_list = ['unix', 'irix', 'irix6', 'irix-6.3'] ))AddPlatform(Platform(    id = 'irix-6.4-mips',    platform = 'irix646',    arch = 'mips',    distribution_id = 'irix-6.4-mips',    family_list = ['unix', 'irix', 'irix646', 'irix-6.4'] ))AddPlatform(Platform(    id = 'irix-6.5-mips',    platform = 'irix646',    arch = 'mips',    distribution_id = 'irix-6.5-mips',    family_list = ['unix', 'irix', 'irix646', 'irix-6.5'] ))AddPlatform(Platform(    id = 'irix-6.2-mips-gcc2.95',    platform = 'irix6',    arch = 'mips',    distribution_id = 'irix-6.5-mips',    family_list = ['unix', 'irix', 'irix6', 'irix-6.2'] ))AddPlatform(Platform(    id = 'linux-2.0-libc5-i386',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.0-libc5-i386',    family_list = ['unix', 'linux', 'linux2', 'linux-2.0'] ))AddPlatform(Platform(    id = 'linux-2.0-libc6-i386',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.0-libc6-i386',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.0-libc6-i386-gcc2.95',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.0-libc6-i386-gcc2.95',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-2.0-libc6-i386-gcc2.95'] ))AddPlatform(Platform(    id = 'linux-2.0-libc6-i386-gcc2.95-el',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.0-libc6-i386-gcc2.95-el',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-2.0-libc6-i386-gcc2.95'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-i386',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.2-libc6-i386',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-2.2-libc6-i386'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-i586',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.2-libc6-i386',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-2.2-libc6-i386',                   'linux-2.2-libc6-i586'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-gcc32-i586',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.2-libc6-gcc32-i586',    family_list = ['unix', 'linux', 'linux2','gcc3', 'linux-glibc-2.0',                   'linux-2.2-libc6-i386'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-i586-server',    platform = 'linux2',    arch = 'i386',    distribution_id = 'linux-2.2-libc6-i586-server',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-2.2-libc6-i386'] ))AddPlatform(Platform(    id = 'linux-2.0-libc6-alpha-gcc2.95',    platform = 'linux2',    arch = 'alpha',    distribution_id = 'linux-2.0-libc6-alpha-gcc2.95',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-powerpc',    platform = 'linux2',    arch = 'powerpc',    distribution_id = 'linux-2.2-libc6-powerpc',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-gcc32-powerpc',    platform = 'linux2',    arch = 'powerpc',    distribution_id = 'linux-2.2-libc6-powerpc',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-sparc',    platform = 'linux2',    arch = 'sparc',    distribution_id = 'linux-2.2-libc6-sparc',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.4-libc6-ia64',    platform = 'linux2',    arch = 'ia64',    distribution_id = 'linux-2.4-libc6-ia64',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-armv4l-cross-gcc2.95',    platform = 'linux2',    arch = 'armv4l',    distribution_id = 'linux-2.2-libc6-armv4l-gcc2.95',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-libc6-armv4l-gcc2.95'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-armv4l-cross-gcc3.2-softfloat',    platform = 'linux2',    arch = 'armv4l',    distribution_id = 'linux-2.2-libc6-armv4l-gcc3.2-softfloat',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-libc6-armv4l-gcc3.2-softfloat'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-armv5te-cross-gcc3.3-softfloat',    platform = 'linux2',    arch = 'armv5te',    distribution_id = 'linux-2.2-libc6-armv5te-gcc3.3-softfloat',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-libc6-armv5te-gcc3.3-softfloat'] ))AddPlatform(Platform(    id = 'linux-2.2-libc6-armv5te-cross-gcc3.3-iwmmxt-softfloat',    platform = 'linux2',    arch = 'armv5te',    distribution_id = 'linux-2.2-libc6-armv5te-gcc3.3-iwmmxt-softfloat',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-libc6-armv5te-gcc3.3-iwmmxt-softfloat'] ))AddPlatform(Platform(    id = 'linux-2.2-mizi-armv4l-xscale',    platform = 'linux2',    arch = 'armv4l',    distribution_id = 'linux-2.2-mizi-armv4l-xscale',    family_list = ['unix', 'linux', 'linux2', 'linux-glibc-2.0',                   'linux-arm',                   'linux-2.2-mizi-armv4l-xscale'] ))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -