1
1
#!/usr/bin/env python
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
4
possible. It makes this information available via function APIs.
5
5
6
6
If called from the command line, it prints the platform
20
20
# * support for Amiga and other still unsupported platforms running Python
21
21
# * support for additional Linux distributions
22
22
#
23
- # Many thanks to all those who helped adding platform specific
23
+ # Many thanks to all those who helped adding platform- specific
24
24
# checks (in no particular order):
25
25
#
26
26
# Charles G Waldman, David Arnold, Gordon McMillan, Ben Darnell,
@@ -118,15 +118,15 @@ def libc_ver(executable=sys.executable,lib='',version='',
118
118
119
119
chunksize = 2048 ):
120
120
121
- """ Tries to determine the libc version against which the
122
- file executable ( defaults to the Python interpreter) is linked.
121
+ """ Tries to determine the libc version that the file executable
122
+ (which defaults to the Python interpreter) is linked against .
123
123
124
124
Returns a tuple of strings (lib,version) which default to the
125
125
given parameters in case the lookup fails.
126
126
127
127
Note that the function has intimate knowledge of how different
128
- libc versions add symbols to the executable is probably only
129
- useable for executables compiled using gcc.
128
+ libc versions add symbols to the executable and thus is probably
129
+ only useable for executables compiled using gcc.
130
130
131
131
The file is read and scanned in chunks of chunksize bytes.
132
132
@@ -219,13 +219,13 @@ def dist(distname='',version='',id='',
219
219
220
220
supported_dists = ('SuSE' ,'debian' ,'redhat' ,'mandrake' )):
221
221
222
- """ Tries to determine the name of the OS distribution name
222
+ """ Tries to determine the name of the Linux OS distribution name.
223
223
224
224
The function first looks for a distribution release file in
225
225
/etc and then reverts to _dist_try_harder() in case no
226
226
suitable files are found.
227
227
228
- Returns a tuple distname,version,id which default to the
228
+ Returns a tuple ( distname,version,id) which default to the
229
229
args given as parameters.
230
230
231
231
"""
@@ -351,7 +351,7 @@ def popen(cmd, mode='r', bufsize=None):
351
351
352
352
def _norm_version (version ,build = '' ):
353
353
354
- """ Normalize the version and build strings and return a sinlge
354
+ """ Normalize the version and build strings and return a single
355
355
vesion string using the format major.minor.build (or patchlevel).
356
356
"""
357
357
l = string .split (version ,'.' )
@@ -544,8 +544,8 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
544
544
versioninfo, machine) with versioninfo being a tuple (version,
545
545
dev_stage, non_release_version).
546
546
547
- Entries which cannot be determined are set to ''. All tuple
548
- entries are strings.
547
+ Entries which cannot be determined are set to the paramter values
548
+ which default to ''. All tuple entries are strings.
549
549
550
550
Thanks to Mark R. Levinson for mailing documentation links and
551
551
code examples for this function. Documentation for the
@@ -595,7 +595,7 @@ def _java_getprop(name,default):
595
595
596
596
def java_ver (release = '' ,vendor = '' ,vminfo = ('' ,'' ,'' ),osinfo = ('' ,'' ,'' )):
597
597
598
- """ Version interface for JPython .
598
+ """ Version interface for Jython .
599
599
600
600
Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being
601
601
a tuple (vm_name,vm_release,vm_vendor) and osinfo being a
@@ -815,9 +815,9 @@ def _syscmd_file(target,default=''):
815
815
def architecture (executable = sys .executable ,bits = '' ,linkage = '' ):
816
816
817
817
""" Queries the given executable (defaults to the Python interpreter
818
- binary) for various architecture informations .
818
+ binary) for various architecture information .
819
819
820
- Returns a tuple (bits,linkage) which contain information about
820
+ Returns a tuple (bits,linkage) which contains information about
821
821
the bit architecture and the linkage format used for the
822
822
executable. Both values are returned as strings.
823
823
@@ -828,9 +828,9 @@ def architecture(executable=sys.executable,bits='',linkage=''):
828
828
829
829
The function relies on the system's "file" command to do the
830
830
actual work. This is available on most if not all Unix
831
- platforms. On some non-Unix platforms and then only if the
832
- executable points to the Python interpreter defaults from
833
- _default_architecture are used.
831
+ platforms. On some non-Unix platforms where the "file" command
832
+ does not exist and the executable is set to the Python interpreter
833
+ binary defaults from _default_architecture are used.
834
834
835
835
"""
836
836
# Use the sizeof(pointer) as default number of bits if nothing
@@ -905,7 +905,7 @@ def uname():
905
905
identifying the underlying platform.
906
906
907
907
Note that unlike the os.uname function this also returns
908
- possible processor information as additional tuple entry.
908
+ possible processor information as an additional tuple entry.
909
909
910
910
Entries which cannot be determined are set to ''.
911
911
@@ -1013,7 +1013,8 @@ def system():
1013
1013
1014
1014
def node ():
1015
1015
1016
- """ Returns the computer's network name (may not be fully qualified !)
1016
+ """ Returns the computer's network name (which may not be fully
1017
+ qualified)
1017
1018
1018
1019
An empty string is returned if the value cannot be determined.
1019
1020
0 commit comments