Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
site-packages
/
rhpl
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/site-packages/rhpl/__init__.py
# dummy __init__ so that things work def getArch (): import os arch = os.uname ()[4] if (len (arch) == 4 and arch[0] == 'i' and arch[2:4] == "86"): arch = "i386" if arch == "sparc64": arch = "sparc" if arch == "ppc64": arch = "ppc" if arch == "s390x": arch = "s390" return arch # return the ppc machine variety type def getPPCMachine(): machine = None # ppc machine hash ppcType = { 'Mac' : 'PMac', 'Book' : 'PMac', 'CHRP IBM' : 'pSeries', 'Pegasos' : 'Pegasos', 'iSeries' : 'iSeries', 'PReP' : 'PReP', 'CHRP' : 'pSeries', 'Amiga' : 'APUS', 'Gemini' : 'Gemini', 'Shiner' : 'ANS', 'BRIQ' : 'BRIQ', 'Teron' : 'Teron', 'AmigaOne' : 'Teron' } if getArch() != "ppc": return 0 f = open('/proc/cpuinfo', 'r') lines = f.readlines() f.close() for line in lines: if line.find('machine') != -1: machine = line.split(':')[1] break if machine is None: return None for type in ppcType.items(): if machine.find(type[0]) != -1: return type[1] return 0