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
cd947e0c
Kaydet (Commit)
cd947e0c
authored
Tem 04, 2009
tarafından
Tarek Ziadé
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
using print statements when used for user interaction
üst
63f1738d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
29 deletions
+11
-29
dist.py
Lib/distutils/dist.py
+11
-11
test_dist.py
Lib/distutils/tests/test_dist.py
+0
-18
No files found.
Lib/distutils/dist.py
Dosyayı görüntüle @
cd947e0c
...
@@ -602,14 +602,14 @@ Common commands: (see '--help-commands' for more)
...
@@ -602,14 +602,14 @@ Common commands: (see '--help-commands' for more)
options
=
self
.
global_options
options
=
self
.
global_options
parser
.
set_option_table
(
options
)
parser
.
set_option_table
(
options
)
parser
.
print_help
(
self
.
common_usage
+
"
\n
Global options:"
)
parser
.
print_help
(
self
.
common_usage
+
"
\n
Global options:"
)
self
.
announce
(
''
)
print
(
''
)
if
display_options
:
if
display_options
:
parser
.
set_option_table
(
self
.
display_options
)
parser
.
set_option_table
(
self
.
display_options
)
parser
.
print_help
(
parser
.
print_help
(
"Information display options (just display "
+
"Information display options (just display "
+
"information, ignore any commands)"
)
"information, ignore any commands)"
)
self
.
announce
(
''
)
print
(
''
)
for
command
in
self
.
commands
:
for
command
in
self
.
commands
:
if
isinstance
(
command
,
type
)
and
issubclass
(
command
,
Command
):
if
isinstance
(
command
,
type
)
and
issubclass
(
command
,
Command
):
...
@@ -623,9 +623,9 @@ Common commands: (see '--help-commands' for more)
...
@@ -623,9 +623,9 @@ Common commands: (see '--help-commands' for more)
else
:
else
:
parser
.
set_option_table
(
klass
.
user_options
)
parser
.
set_option_table
(
klass
.
user_options
)
parser
.
print_help
(
"Options for '
%
s' command:"
%
klass
.
__name__
)
parser
.
print_help
(
"Options for '
%
s' command:"
%
klass
.
__name__
)
self
.
announce
(
''
)
print
(
''
)
self
.
announce
(
gen_usage
(
self
.
script_name
))
print
(
gen_usage
(
self
.
script_name
))
def
handle_display_options
(
self
,
option_order
):
def
handle_display_options
(
self
,
option_order
):
"""If there were any non-global "display-only" options
"""If there were any non-global "display-only" options
...
@@ -640,8 +640,8 @@ Common commands: (see '--help-commands' for more)
...
@@ -640,8 +640,8 @@ Common commands: (see '--help-commands' for more)
# we ignore "foo bar").
# we ignore "foo bar").
if
self
.
help_commands
:
if
self
.
help_commands
:
self
.
print_commands
()
self
.
print_commands
()
self
.
announce
(
''
)
print
(
''
)
self
.
announce
(
gen_usage
(
self
.
script_name
))
print
(
gen_usage
(
self
.
script_name
))
return
1
return
1
# If user supplied any of the "display metadata" options, then
# If user supplied any of the "display metadata" options, then
...
@@ -657,12 +657,12 @@ Common commands: (see '--help-commands' for more)
...
@@ -657,12 +657,12 @@ Common commands: (see '--help-commands' for more)
opt
=
translate_longopt
(
opt
)
opt
=
translate_longopt
(
opt
)
value
=
getattr
(
self
.
metadata
,
"get_"
+
opt
)()
value
=
getattr
(
self
.
metadata
,
"get_"
+
opt
)()
if
opt
in
[
'keywords'
,
'platforms'
]:
if
opt
in
[
'keywords'
,
'platforms'
]:
self
.
announce
(
','
.
join
(
value
))
print
(
','
.
join
(
value
))
elif
opt
in
(
'classifiers'
,
'provides'
,
'requires'
,
elif
opt
in
(
'classifiers'
,
'provides'
,
'requires'
,
'obsoletes'
):
'obsoletes'
):
self
.
announce
(
'
\n
'
.
join
(
value
))
print
(
'
\n
'
.
join
(
value
))
else
:
else
:
self
.
announce
(
value
)
print
(
value
)
any_display_options
=
1
any_display_options
=
1
return
any_display_options
return
any_display_options
...
@@ -671,7 +671,7 @@ Common commands: (see '--help-commands' for more)
...
@@ -671,7 +671,7 @@ Common commands: (see '--help-commands' for more)
"""Print a subset of the list of all commands -- used by
"""Print a subset of the list of all commands -- used by
'print_commands()'.
'print_commands()'.
"""
"""
self
.
announce
(
header
+
":"
)
print
(
header
+
":"
)
for
cmd
in
commands
:
for
cmd
in
commands
:
klass
=
self
.
cmdclass
.
get
(
cmd
)
klass
=
self
.
cmdclass
.
get
(
cmd
)
...
@@ -682,7 +682,7 @@ Common commands: (see '--help-commands' for more)
...
@@ -682,7 +682,7 @@ Common commands: (see '--help-commands' for more)
except
AttributeError
:
except
AttributeError
:
description
=
"(no description available)"
description
=
"(no description available)"
self
.
announce
(
"
%-*
s
%
s"
%
(
max_length
,
cmd
,
description
))
print
(
"
%-*
s
%
s"
%
(
max_length
,
cmd
,
description
))
def
print_commands
(
self
):
def
print_commands
(
self
):
"""Print out a help message listing all available commands with a
"""Print out a help message listing all available commands with a
...
...
Lib/distutils/tests/test_dist.py
Dosyayı görüntüle @
cd947e0c
...
@@ -165,24 +165,6 @@ class DistributionTestCase(support.TempdirManager,
...
@@ -165,24 +165,6 @@ class DistributionTestCase(support.TempdirManager,
self
.
assertEquals
(
dist
.
metadata
.
platforms
,
[
'one'
,
'two'
])
self
.
assertEquals
(
dist
.
metadata
.
platforms
,
[
'one'
,
'two'
])
self
.
assertEquals
(
dist
.
metadata
.
keywords
,
[
'one'
,
'two'
])
self
.
assertEquals
(
dist
.
metadata
.
keywords
,
[
'one'
,
'two'
])
def
test_show_help
(
self
):
class
FancyGetopt
(
object
):
def
__init__
(
self
):
self
.
count
=
0
def
set_option_table
(
self
,
*
args
):
pass
def
print_help
(
self
,
*
args
):
self
.
count
+=
1
parser
=
FancyGetopt
()
dist
=
Distribution
()
dist
.
commands
=
[
'sdist'
]
dist
.
script_name
=
'setup.py'
dist
.
_show_help
(
parser
)
self
.
assertEquals
(
parser
.
count
,
3
)
def
test_get_command_packages
(
self
):
def
test_get_command_packages
(
self
):
dist
=
Distribution
()
dist
=
Distribution
()
self
.
assertEquals
(
dist
.
command_packages
,
None
)
self
.
assertEquals
(
dist
.
command_packages
,
None
)
...
...
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