Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(79)

Side by Side Diff: Lib/platform.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/packaging/util.py ('k') | Lib/plat-linux3/CDROM.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 2
3 """ This module tries to retrieve as much platform-identifying data as 3 """ This module tries to retrieve as much platform-identifying data as
4 possible. It makes this information available via function APIs. 4 possible. It makes this information available via function APIs.
5 5
6 If called from the command line, it prints the platform 6 If called from the command line, it prints the platform
7 information concatenated as single string to stdout. The output 7 information concatenated as single string to stdout. The output
8 format is useable as part of a filename. 8 format is useable as part of a filename.
9 9
10 """ 10 """
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 major,minor,patch = _mac_ver_lookup(('sys1','sys2','sys3')) 672 major,minor,patch = _mac_ver_lookup(('sys1','sys2','sys3'))
673 release = '%i.%i.%i' %(major, minor, patch) 673 release = '%i.%i.%i' %(major, minor, patch)
674 else: 674 else:
675 release = '%s.%i.%i' % (_bcd2str(major),minor,patch) 675 release = '%s.%i.%i' % (_bcd2str(major),minor,patch)
676 676
677 if sysa: 677 if sysa:
678 machine = {0x1: '68k', 678 machine = {0x1: '68k',
679 0x2: 'PowerPC', 679 0x2: 'PowerPC',
680 0xa: 'i386'}.get(sysa,'') 680 0xa: 'i386'}.get(sysa,'')
681 681
682 versioninfo=('', '', '')
683 return release,versioninfo,machine 682 return release,versioninfo,machine
684 683
685 def _mac_ver_xml(): 684 def _mac_ver_xml():
686 fn = '/System/Library/CoreServices/SystemVersion.plist' 685 fn = '/System/Library/CoreServices/SystemVersion.plist'
687 if not os.path.exists(fn): 686 if not os.path.exists(fn):
688 return None 687 return None
689 688
690 try: 689 try:
691 import plistlib 690 import plistlib
692 except ImportError: 691 except ImportError:
(...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after
1496 return platform 1495 return platform
1497 1496
1498 ### Command line interface 1497 ### Command line interface
1499 1498
1500 if __name__ == '__main__': 1499 if __name__ == '__main__':
1501 # Default is to print the aliased verbose platform string 1500 # Default is to print the aliased verbose platform string
1502 terse = ('terse' in sys.argv or '--terse' in sys.argv) 1501 terse = ('terse' in sys.argv or '--terse' in sys.argv)
1503 aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv) 1502 aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv)
1504 print(platform(aliased,terse)) 1503 print(platform(aliased,terse))
1505 sys.exit(0) 1504 sys.exit(0)
OLDNEW
« no previous file with comments | « Lib/packaging/util.py ('k') | Lib/plat-linux3/CDROM.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+