2
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
3
# See LICENSE for details.
12
def shortPythonVersion():
14
major = (hv & 0xff000000L) >> 24
15
minor = (hv & 0x00ff0000L) >> 16
16
teeny = (hv & 0x0000ff00L) >> 8
17
return "%s.%s.%s" % (major,minor,teeny)
24
'org.python.modules.os': 'java',
33
"""Gives us information about the platform we're running on"""
35
type = knownPlatforms.get(os.name)
36
seconds = staticmethod(_timeFunctions.get(type, time.time))
38
def __init__(self, name=None):
40
self.type = knownPlatforms.get(name)
41
self.seconds = _timeFunctions.get(self.type, time.time)
44
"""Do we know about this platform?"""
45
return self.type != None
48
"""Return 'posix', 'win32' or 'java'"""
52
"""Return if we are runnng on Mac OS X."""
53
return sys.platform == "darwin"
56
"""Are we running in Windows NT?"""
57
if self.getType() == 'win32':
60
k=_winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE,
61
r'Software\Microsoft\Windows NT\CurrentVersion')
62
_winreg.QueryValueEx(k, 'SystemRoot')
70
return self.getType() == 'win32'
72
def supportsThreads(self):
73
"""Can threads be created?
76
return imp.find_module('thread')[0] is None
81
platformType = platform.getType()
82
seconds = platform.seconds