Lines Matching defs:platform
3 """ This module tries to retrieve as much platform-identifying data as
6 If called from the command line, it prints the platform
20 # Many thanks to all those who helped adding platform-specific
73 # 0.4.0 - added win32_ver() and modified the platform() output for WinXX
76 # 0.3.2 - added architecture() API and support for it in platform()
81 # 0.2.1 - added cache logic and changed the platform string format
88 # http://www.egenix.com/files/python/platform.py
277 if sys.platform not in supported_platforms:
316 # Strictly, 5.2 client is XP 64-bit, but platform.py historically
545 """ Helper to format the platform string in a filename
548 # Format the platform string
549 platform = '-'.join(x.strip() for x in filter(len, args))
552 platform = platform.replace(' ', '_')
553 platform = platform.replace('/', '-')
554 platform = platform.replace('\\', '-')
555 platform = platform.replace(':', '-')
556 platform = platform.replace(';', '-')
557 platform = platform.replace('"', '-')
558 platform = platform.replace('(', '-')
559 platform = platform.replace(')', '-')
562 platform = platform.replace('unknown', '')
566 cleaned = platform.replace('--', '-')
567 if cleaned == platform:
569 platform = cleaned
570 while platform[-1] == '-':
571 platform = platform[:-1]
573 return platform
611 if sys.platform in ('dos', 'win32', 'win16'):
684 if sys.platform in _default_architecture:
685 b, l = _default_architecture[sys.platform]
738 func = getattr(cls, f'get_{sys.platform}', cls.from_subprocess)
829 identifying the underlying platform.
846 system = sys.platform
1049 elif sys.platform.startswith('java'):
1060 compiler = sys.platform
1183 ### The Opus Magnum of platform strings :-)
1187 def platform(aliased=0, terse=0):
1189 """ Returns a single string identifying the underlying platform
1203 absolute minimum information needed to identify the platform.
1210 # Get uname information and then apply platform specific cosmetics
1229 platform = _platform(system, release)
1231 platform = _platform(system, release, version, csd)
1236 platform = _platform(system, release, machine, processor,
1243 platform = _platform(system, release, version)
1245 platform = _platform(system, release, version,
1252 platform = _platform(system, release)
1255 platform = _platform(system, release, machine,
1258 _platform_cache[(aliased, terse)] = platform
1259 return platform
1321 # Default is to print the aliased verbose platform string
1324 print(platform(aliased, terse))