Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
I
inary
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)
1
Konular (issue)
1
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ç
SulinOS
inary
Commits
ca0a8aa0
Kaydet (Commit)
ca0a8aa0
authored
Ara 18, 2005
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* show one line description for commands in general help
* less frightening message for normal errors
üst
1a4a015f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
pisi-cli
pisi-cli
+6
-3
commands.py
pisi/cli/commands.py
+8
-5
No files found.
pisi-cli
Dosyayı görüntüle @
ca0a8aa0
...
...
@@ -35,7 +35,7 @@ def handle_exception(exception, value, tb):
ui
.
error
(
_
(
"Keyboard Interrupt: Exiting..."
))
exit
()
elif
isinstance
(
value
,
pisi
.
Error
):
ui
.
error
(
_
(
"
Fatal Error.
Program Terminated."
))
ui
.
error
(
_
(
"Program Terminated."
))
show_traceback
=
ctx
.
get_option
(
'debug'
)
elif
isinstance
(
value
,
pisi
.
Exception
):
show_traceback
=
True
...
...
@@ -50,8 +50,11 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
v
=
''
for
e
in
value
.
args
:
v
+=
str
(
e
)
+
'
\n
'
ui
.
error
(
"
%
s:
%
s"
%
(
exception
,
v
))
if
ctx
.
get_option
(
'debug'
):
ui
.
error
(
"
%
s:
%
s"
%
(
exception
,
v
))
else
:
ui
.
error
(
v
)
ui
.
info
(
_
(
"Please use 'pisi help' for general help."
))
...
...
pisi/cli/commands.py
Dosyayı görüntüle @
ca0a8aa0
...
...
@@ -37,15 +37,18 @@ class Command(object):
cmd
=
[]
cmd_dict
=
{}
@staticmethod
def
commands_string
():
s
=
''
list
=
[
x
.
name
[
0
]
for
x
in
Command
.
cmd
]
list
.
sort
()
for
x
in
list
:
s
+=
x
+
'
\n
'
for
name
in
list
:
command
=
Command
.
get_command
(
name
)
summary
=
command
.
__doc__
.
split
(
'
\n
'
)[
0
]
s
+=
'
%25
s -
%
s
\n
'
%
(
command
.
format_name
(),
summary
)
return
s
commands_string
=
staticmethod
(
commands_string
)
@staticmethod
def
get_command
(
cmd
,
fail
=
False
):
if
Command
.
cmd_dict
.
has_key
(
cmd
):
...
...
@@ -55,7 +58,6 @@ class Command(object):
raise
Error
(
_
(
"Unrecognized command:
%
s"
)
%
cmd
)
else
:
return
None
get_command
=
staticmethod
(
get_command
)
# instance variabes
...
...
@@ -205,6 +207,7 @@ If run without parameters, it prints the general help."""
name
=
(
"help"
,
"h"
)
def
run
(
self
):
if
not
self
.
args
:
self
.
parser
.
set_usage
(
usage_text
)
pisi
.
cli
.
printu
(
self
.
parser
.
format_help
())
...
...
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