Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
8ab27dfa
Kaydet (Commit)
8ab27dfa
authored
Agu 05, 2003
tarafından
Brett Cannon
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Touch-up to docstrings.
üst
b278ac4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
platform.py
Lib/platform.py
+20
-19
No files found.
Lib/platform.py
Dosyayı görüntüle @
8ab27dfa
#!/usr/bin/env python
#!/usr/bin/env python
""" This module tries to retrieve as much platform
identifying data as
""" This module tries to retrieve as much platform
-
identifying data as
possible. It makes this information available via function APIs.
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
If called from the command line, it prints the platform
...
@@ -20,7 +20,7 @@
...
@@ -20,7 +20,7 @@
# * support for Amiga and other still unsupported platforms running Python
# * support for Amiga and other still unsupported platforms running Python
# * support for additional Linux distributions
# * support for additional Linux distributions
#
#
# Many thanks to all those who helped adding platform
specific
# Many thanks to all those who helped adding platform
-
specific
# checks (in no particular order):
# checks (in no particular order):
#
#
# Charles G Waldman, David Arnold, Gordon McMillan, Ben Darnell,
# Charles G Waldman, David Arnold, Gordon McMillan, Ben Darnell,
...
@@ -118,15 +118,15 @@ def libc_ver(executable=sys.executable,lib='',version='',
...
@@ -118,15 +118,15 @@ def libc_ver(executable=sys.executable,lib='',version='',
chunksize
=
2048
):
chunksize
=
2048
):
""" Tries to determine the libc version
against which th
e
""" Tries to determine the libc version
that the file executabl
e
file executable (defaults to the Python interpreter) is linked
.
(which defaults to the Python interpreter) is linked against
.
Returns a tuple of strings (lib,version) which default to the
Returns a tuple of strings (lib,version) which default to the
given parameters in case the lookup fails.
given parameters in case the lookup fails.
Note that the function has intimate knowledge of how different
Note that the function has intimate knowledge of how different
libc versions add symbols to the executable
is probably on
ly
libc versions add symbols to the executable
and thus is probab
ly
useable for executables compiled using gcc.
only
useable for executables compiled using gcc.
The file is read and scanned in chunks of chunksize bytes.
The file is read and scanned in chunks of chunksize bytes.
...
@@ -219,13 +219,13 @@ def dist(distname='',version='',id='',
...
@@ -219,13 +219,13 @@ def dist(distname='',version='',id='',
supported_dists
=
(
'SuSE'
,
'debian'
,
'redhat'
,
'mandrake'
)):
supported_dists
=
(
'SuSE'
,
'debian'
,
'redhat'
,
'mandrake'
)):
""" Tries to determine the name of the
OS distribution name
""" Tries to determine the name of the
Linux OS distribution name.
The function first looks for a distribution release file in
The function first looks for a distribution release file in
/etc and then reverts to _dist_try_harder() in case no
/etc and then reverts to _dist_try_harder() in case no
suitable files are found.
suitable files are found.
Returns a tuple
distname,version,id
which default to the
Returns a tuple
(distname,version,id)
which default to the
args given as parameters.
args given as parameters.
"""
"""
...
@@ -351,7 +351,7 @@ def popen(cmd, mode='r', bufsize=None):
...
@@ -351,7 +351,7 @@ def popen(cmd, mode='r', bufsize=None):
def
_norm_version
(
version
,
build
=
''
):
def
_norm_version
(
version
,
build
=
''
):
""" Normalize the version and build strings and return a sin
lg
e
""" Normalize the version and build strings and return a sin
gl
e
vesion string using the format major.minor.build (or patchlevel).
vesion string using the format major.minor.build (or patchlevel).
"""
"""
l
=
string
.
split
(
version
,
'.'
)
l
=
string
.
split
(
version
,
'.'
)
...
@@ -544,8 +544,8 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
...
@@ -544,8 +544,8 @@ def mac_ver(release='',versioninfo=('','',''),machine=''):
versioninfo, machine) with versioninfo being a tuple (version,
versioninfo, machine) with versioninfo being a tuple (version,
dev_stage, non_release_version).
dev_stage, non_release_version).
Entries which cannot be determined are set to
''. All tuple
Entries which cannot be determined are set to
the paramter values
entries are strings.
which default to ''. All tuple
entries are strings.
Thanks to Mark R. Levinson for mailing documentation links and
Thanks to Mark R. Levinson for mailing documentation links and
code examples for this function. Documentation for the
code examples for this function. Documentation for the
...
@@ -595,7 +595,7 @@ def _java_getprop(name,default):
...
@@ -595,7 +595,7 @@ def _java_getprop(name,default):
def
java_ver
(
release
=
''
,
vendor
=
''
,
vminfo
=
(
''
,
''
,
''
),
osinfo
=
(
''
,
''
,
''
)):
def
java_ver
(
release
=
''
,
vendor
=
''
,
vminfo
=
(
''
,
''
,
''
),
osinfo
=
(
''
,
''
,
''
)):
""" Version interface for J
P
ython.
""" Version interface for Jython.
Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being
Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being
a tuple (vm_name,vm_release,vm_vendor) and osinfo being a
a tuple (vm_name,vm_release,vm_vendor) and osinfo being a
...
@@ -815,9 +815,9 @@ _architecture_split = re.compile(r'[\s,]').split
...
@@ -815,9 +815,9 @@ _architecture_split = re.compile(r'[\s,]').split
def
architecture
(
executable
=
sys
.
executable
,
bits
=
''
,
linkage
=
''
):
def
architecture
(
executable
=
sys
.
executable
,
bits
=
''
,
linkage
=
''
):
""" Queries the given executable (defaults to the Python interpreter
""" Queries the given executable (defaults to the Python interpreter
binary) for various architecture information
s
.
binary) for various architecture information.
Returns a tuple (bits,linkage) which contain information about
Returns a tuple (bits,linkage) which contain
s
information about
the bit architecture and the linkage format used for the
the bit architecture and the linkage format used for the
executable. Both values are returned as strings.
executable. Both values are returned as strings.
...
@@ -828,9 +828,9 @@ def architecture(executable=sys.executable,bits='',linkage=''):
...
@@ -828,9 +828,9 @@ def architecture(executable=sys.executable,bits='',linkage=''):
The function relies on the system's "file" command to do the
The function relies on the system's "file" command to do the
actual work. This is available on most if not all Unix
actual work. This is available on most if not all Unix
platforms. On some non-Unix platforms
and then only if the
platforms. On some non-Unix platforms
where the "file" command
executable points to the Python interpreter defaults from
does not exist and the executable is set to the Python interpreter
_default_architecture are used.
binary defaults from
_default_architecture are used.
"""
"""
# Use the sizeof(pointer) as default number of bits if nothing
# Use the sizeof(pointer) as default number of bits if nothing
...
@@ -905,7 +905,7 @@ def uname():
...
@@ -905,7 +905,7 @@ def uname():
identifying the underlying platform.
identifying the underlying platform.
Note that unlike the os.uname function this also returns
Note that unlike the os.uname function this also returns
possible processor information as additional tuple entry.
possible processor information as a
n a
dditional tuple entry.
Entries which cannot be determined are set to ''.
Entries which cannot be determined are set to ''.
...
@@ -1013,7 +1013,8 @@ def system():
...
@@ -1013,7 +1013,8 @@ def system():
def
node
():
def
node
():
""" Returns the computer's network name (may not be fully qualified !)
""" Returns the computer's network name (which may not be fully
qualified)
An empty string is returned if the value cannot be determined.
An empty string is returned if the value cannot be determined.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment