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)
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ç
SulinOS
inary
Commits
8b1518e7
Kaydet (Commit)
8b1518e7
authored
Haz 08, 2006
tarafından
Barış Metin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix #2906: no traceback for CLI errors...
üst
529d7a21
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
pisi-cli
pisi-cli
+3
-2
pisicli.py
pisi/cli/pisicli.py
+7
-3
No files found.
pisi-cli
Dosyayı görüntüle @
8b1518e7
...
@@ -19,7 +19,7 @@ import bsddb3.db as db
...
@@ -19,7 +19,7 @@ import bsddb3.db as db
import
pisi.ui
import
pisi.ui
import
pisi.context
as
ctx
import
pisi.context
as
ctx
from
pisi.cli.pisicli
import
PisiCLI
from
pisi.cli.pisicli
import
PisiCLI
,
CLIError
import
gettext
import
gettext
__trans
=
gettext
.
translation
(
'pisi'
,
fallback
=
True
)
__trans
=
gettext
.
translation
(
'pisi'
,
fallback
=
True
)
...
@@ -64,7 +64,8 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
...
@@ -64,7 +64,8 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
ui
.
info
(
_
(
"Traceback:"
))
ui
.
info
(
_
(
"Traceback:"
))
traceback
.
print_tb
(
tb
)
traceback
.
print_tb
(
tb
)
else
:
else
:
ui
.
info
(
_
(
"Use --debug to see a traceback."
))
if
not
exception
is
CLIError
:
ui
.
info
(
_
(
"Use --debug to see a traceback."
))
exit
()
exit
()
...
...
pisi/cli/pisicli.py
Dosyayı görüntüle @
8b1518e7
...
@@ -29,6 +29,10 @@ class ParserError(pisi.Exception):
...
@@ -29,6 +29,10 @@ class ParserError(pisi.Exception):
class
Error
(
pisi
.
Error
):
class
Error
(
pisi
.
Error
):
pass
pass
class
CLIError
(
Error
):
pass
class
PreParser
(
OptionParser
):
class
PreParser
(
OptionParser
):
"""consumes any options, and finds arguments from command line"""
"""consumes any options, and finds arguments from command line"""
...
@@ -94,14 +98,14 @@ class PisiCLI(object):
...
@@ -94,14 +98,14 @@ class PisiCLI(object):
sys
.
exit
(
0
)
sys
.
exit
(
0
)
elif
'help'
in
opts
or
'h'
in
opts
:
elif
'help'
in
opts
or
'h'
in
opts
:
self
.
die
()
self
.
die
()
raise
Error
(
_
(
'No command given'
))
raise
CLI
Error
(
_
(
'No command given'
))
cmd_name
=
args
[
0
]
cmd_name
=
args
[
0
]
except
ParserError
:
except
ParserError
:
raise
Error
(
_
(
'Command line parsing error'
))
raise
CLI
Error
(
_
(
'Command line parsing error'
))
self
.
command
=
Command
.
get_command
(
cmd_name
,
args
=
orig_args
)
self
.
command
=
Command
.
get_command
(
cmd_name
,
args
=
orig_args
)
if
not
self
.
command
:
if
not
self
.
command
:
raise
Error
(
_
(
"Unrecognized command:
%
s"
)
%
cmd_name
)
raise
CLI
Error
(
_
(
"Unrecognized command:
%
s"
)
%
cmd_name
)
def
die
(
self
):
def
die
(
self
):
printu
(
'
\n
'
+
self
.
parser
.
format_help
())
printu
(
'
\n
'
+
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