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
cc118178
Kaydet (Commit)
cc118178
authored
Şub 02, 2010
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
module reorganization + missing doctests
üst
526e421b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
37 deletions
+43
-37
sysconfig.py
Lib/sysconfig.py
+43
-37
No files found.
Lib/sysconfig.py
Dosyayı görüntüle @
cc118178
...
...
@@ -235,49 +235,12 @@ def _parse_makefile(filename, vars=None):
vars
.
update
(
done
)
return
vars
def
parse_config_h
(
fp
,
vars
=
None
):
"""Parse a config.h-style file.
A dictionary containing name/value pairs is returned. If an
optional dictionary is passed in as the second argument, it is
used instead of a new dictionary.
"""
import
re
if
vars
is
None
:
vars
=
{}
define_rx
=
re
.
compile
(
"#define ([A-Z][A-Za-z0-9_]+) (.*)
\n
"
)
undef_rx
=
re
.
compile
(
"/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
\n
"
)
while
True
:
line
=
fp
.
readline
()
if
not
line
:
break
m
=
define_rx
.
match
(
line
)
if
m
:
n
,
v
=
m
.
group
(
1
,
2
)
try
:
v
=
int
(
v
)
except
ValueError
:
pass
vars
[
n
]
=
v
else
:
m
=
undef_rx
.
match
(
line
)
if
m
:
vars
[
m
.
group
(
1
)]
=
0
return
vars
def
_get_makefile_filename
():
if
_PYTHON_BUILD
:
return
os
.
path
.
join
(
_PROJECT_BASE
,
"Makefile"
)
return
os
.
path
.
join
(
get_path
(
'stdlib'
),
"config"
,
"Makefile"
)
def
get_config_h_filename
():
if
_PYTHON_BUILD
:
if
os
.
name
==
"nt"
:
inc_dir
=
os
.
path
.
join
(
_PROJECT_BASE
,
"PC"
)
else
:
inc_dir
=
_PROJECT_BASE
else
:
inc_dir
=
get_path
(
'platinclude'
)
return
os
.
path
.
join
(
inc_dir
,
'pyconfig.h'
)
def
_init_posix
(
vars
):
"""Initialize the module as appropriate for POSIX systems."""
...
...
@@ -337,10 +300,53 @@ def _init_non_posix(vars):
# public APIs
#
def
parse_config_h
(
fp
,
vars
=
None
):
"""Parse a config.h-style file.
A dictionary containing name/value pairs is returned. If an
optional dictionary is passed in as the second argument, it is
used instead of a new dictionary.
"""
import
re
if
vars
is
None
:
vars
=
{}
define_rx
=
re
.
compile
(
"#define ([A-Z][A-Za-z0-9_]+) (.*)
\n
"
)
undef_rx
=
re
.
compile
(
"/[*] #undef ([A-Z][A-Za-z0-9_]+) [*]/
\n
"
)
while
True
:
line
=
fp
.
readline
()
if
not
line
:
break
m
=
define_rx
.
match
(
line
)
if
m
:
n
,
v
=
m
.
group
(
1
,
2
)
try
:
v
=
int
(
v
)
except
ValueError
:
pass
vars
[
n
]
=
v
else
:
m
=
undef_rx
.
match
(
line
)
if
m
:
vars
[
m
.
group
(
1
)]
=
0
return
vars
def
get_config_h_filename
():
"""Returns the path of pyconfig.h."""
if
_PYTHON_BUILD
:
if
os
.
name
==
"nt"
:
inc_dir
=
os
.
path
.
join
(
_PROJECT_BASE
,
"PC"
)
else
:
inc_dir
=
_PROJECT_BASE
else
:
inc_dir
=
get_path
(
'platinclude'
)
return
os
.
path
.
join
(
inc_dir
,
'pyconfig.h'
)
def
get_scheme_names
():
"""Returns a tuple containing the schemes names."""
return
_INSTALL_SCHEMES
.
keys
()
def
get_path_names
():
"""Returns a tuple containing the paths names."""
return
_SCHEME_KEYS
def
get_paths
(
scheme
=
_get_default_scheme
(),
vars
=
None
,
expand
=
True
):
...
...
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