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
1190ee3d
Kaydet (Commit)
1190ee3d
authored
Ara 18, 1998
tarafından
Greg Ward
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fred's sysconfig module.
üst
a37e2445
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
0 deletions
+106
-0
sysconfig.py
Lib/distutils/sysconfig.py
+106
-0
No files found.
Lib/distutils/sysconfig.py
0 → 100644
Dosyayı görüntüle @
1190ee3d
"""Prototype sysconfig module that loads information when run as a script,
but only defines constants when imported.
This should be run as a script as one of the last steps of the Python
installation process.
Written by: Fred L. Drake, Jr.
Email: <fdrake@acm.org>
Initial date: 17-Dec-1998
"""
__version__
=
"$Revision$"
def
_init_posix
():
import
os
import
re
import
sys
g
=
globals
()
version
=
sys
.
version
[:
3
]
config_dir
=
os
.
path
.
join
(
sys
.
exec_prefix
,
"lib"
,
"python"
+
version
,
"config"
)
# load the installed config.h:
define_rx
=
re
.
compile
(
"#define ([A-Z][A-Z0-9_]+) (.*)
\n
"
)
undef_rx
=
re
.
compile
(
"/[*] #undef ([A-Z][A-Z0-9_]+) [*]/
\n
"
)
fp
=
open
(
os
.
path
.
join
(
config_dir
,
"config.h"
))
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
m
=
define_rx
.
match
(
line
)
if
m
:
n
,
v
=
m
.
group
(
1
,
2
)
if
v
==
"1"
:
g
[
n
]
=
1
else
:
g
[
n
]
=
v
else
:
m
=
undef_rx
.
match
(
line
)
if
m
:
g
[
m
.
group
(
1
)]
=
0
# load the installed Makefile.pre.in:
variable_rx
=
re
.
compile
(
"([a-zA-Z][a-zA-Z0-9_]+)
\
s*=
\
s*(.*)
\n
"
)
done
=
{}
notdone
=
{}
fp
=
open
(
os
.
path
.
join
(
config_dir
,
"Makefile"
))
while
1
:
line
=
fp
.
readline
()
if
not
line
:
break
m
=
variable_rx
.
match
(
line
)
if
m
:
n
,
v
=
m
.
group
(
1
,
2
)
if
"$"
in
v
:
notdone
[
n
]
=
v
else
:
done
[
n
]
=
v
# do variable interpolation here
findvar1_rx
=
re
.
compile
(
r"\$\(([A-Za-z][A-Za-z0-9_]*)\)"
)
findvar2_rx
=
re
.
compile
(
r"\${([A-Za-z][A-Za-z0-9_]*)}"
)
while
notdone
:
for
name
in
notdone
.
keys
():
value
=
notdone
[
name
]
m
=
findvar1_rx
.
search
(
value
)
if
not
m
:
m
=
findvar2_rx
.
search
(
value
)
if
m
:
n
=
m
.
group
(
1
)
if
done
.
has_key
(
n
):
after
=
value
[
m
.
end
():]
value
=
value
[:
m
.
start
()]
+
done
[
n
]
+
after
if
"$"
in
after
:
notdone
[
name
]
=
value
else
:
done
[
name
]
=
value
del
notdone
[
name
]
elif
notdone
.
has_key
(
n
):
# get it on a subsequent round
pass
else
:
done
[
n
]
=
""
after
=
value
[
m
.
end
():]
value
=
value
[:
m
.
start
()]
+
after
if
"$"
in
after
:
notdone
[
name
]
=
value
else
:
done
[
name
]
=
value
del
notdone
[
name
]
else
:
del
notdone
[
name
]
# save the results in the global dictionary
g
.
update
(
done
)
import
os
exec
"_init_
%
s()"
%
os
.
name
del
os
del
_init_posix
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