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
f84fb660
Kaydet (Commit)
f84fb660
authored
Eyl 23, 2000
tarafından
Greg Ward
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Split 'run()' up into 'build()', 'install()', and 'bytecompile()' (for
easier extensibility).
üst
7b87c0e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
8 deletions
+28
-8
install_lib.py
Lib/distutils/command/install_lib.py
+28
-8
No files found.
Lib/distutils/command/install_lib.py
Dosyayı görüntüle @
f84fb660
...
...
@@ -46,31 +46,46 @@ class install_lib (Command):
def
run
(
self
):
# Make sure we have built everything we need first
self
.
build
()
# Install everything: simply dump the entire contents of the build
# directory to the installation directory (that's the beauty of
# having a build directory!)
outfiles
=
self
.
install
()
# (Optionally) compile .py to .pyc
self
.
bytecompile
(
outfiles
)
# run ()
# -- Top-level worker functions ------------------------------------
# (called from 'run()')
def
build
(
self
):
if
not
self
.
skip_build
:
if
self
.
distribution
.
has_pure_modules
():
self
.
run_command
(
'build_py'
)
if
self
.
distribution
.
has_ext_modules
():
self
.
run_command
(
'build_ext'
)
# Install everything: simply dump the entire contents of the build
# directory to the installation directory (that's the beauty of
# having a build directory!)
def
install
(
self
):
if
os
.
path
.
isdir
(
self
.
build_dir
):
outfiles
=
self
.
copy_tree
(
self
.
build_dir
,
self
.
install_dir
)
else
:
self
.
warn
(
"'
%
s' does not exist -- no Python modules to install"
%
self
.
build_dir
)
return
return
outfiles
# (Optionally) compile .py to .pyc
def
bytecompile
(
self
,
files
):
# XXX hey! we can't control whether we optimize or not; that's up
# to the invocation of the current Python interpreter (at least
# according to the py_compile docs). That sucks.
if
self
.
compile
:
from
py_compile
import
compile
for
f
in
out
files
:
for
f
in
files
:
# only compile the file if it is actually a .py file
if
f
[
-
3
:]
==
'.py'
:
out_fn
=
f
+
(
__debug__
and
"c"
or
"o"
)
...
...
@@ -79,9 +94,10 @@ class install_lib (Command):
skip_msg
=
"skipping byte-compilation of
%
s"
%
f
self
.
make_file
(
f
,
out_fn
,
compile
,
(
f
,),
compile_msg
,
skip_msg
)
# run ()
# -- Utility methods -----------------------------------------------
def
_mutate_outputs
(
self
,
has_any
,
build_cmd
,
cmd_option
,
output_dir
):
if
not
has_any
:
...
...
@@ -108,6 +124,10 @@ class install_lib (Command):
return
bytecode_files
# -- External interface --------------------------------------------
# (called by outsiders)
def
get_outputs
(
self
):
"""Return the list of files that would be installed if this command
were actually run. Not affected by the "dry-run" flag or whether
...
...
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