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
b979d52d
Kaydet (Commit)
b979d52d
authored
Haz 08, 2006
tarafından
Eray Özkural
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
* pisicli: we have a uniform exception naming (only name change there)
* improve pisish a little
üst
8b1518e7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
19 deletions
+14
-19
pisi-cli
pisi-cli
+3
-3
pisicli.py
pisi/cli/pisicli.py
+3
-7
pisish
scripts/pisish
+8
-9
No files found.
pisi-cli
Dosyayı görüntüle @
b979d52d
...
...
@@ -19,7 +19,7 @@ import bsddb3.db as db
import
pisi.ui
import
pisi.context
as
ctx
from
pisi.cli.pisicli
import
PisiCLI
,
CLIError
import
pisi.cli.pisicli
as
pisicli
import
gettext
__trans
=
gettext
.
translation
(
'pisi'
,
fallback
=
True
)
...
...
@@ -64,7 +64,7 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
ui
.
info
(
_
(
"Traceback:"
))
traceback
.
print_tb
(
tb
)
else
:
if
not
exception
is
CLI
Error
:
if
not
exception
is
pisicli
.
Error
:
ui
.
info
(
_
(
"Use --debug to see a traceback."
))
exit
()
...
...
@@ -74,7 +74,7 @@ if __name__ == "__main__":
sys
.
excepthook
=
handle_exception
locale
.
setlocale
(
locale
.
LC_ALL
,
''
)
cli
=
PisiCLI
()
cli
=
pisicli
.
PisiCLI
()
try
:
cli
.
run_command
()
except
pisi
.
operations
.
PisiUpgradeException
,
e
:
...
...
pisi/cli/pisicli.py
Dosyayı görüntüle @
b979d52d
...
...
@@ -29,10 +29,6 @@ class ParserError(pisi.Exception):
class
Error
(
pisi
.
Error
):
pass
class
CLIError
(
Error
):
pass
class
PreParser
(
OptionParser
):
"""consumes any options, and finds arguments from command line"""
...
...
@@ -98,14 +94,14 @@ class PisiCLI(object):
sys
.
exit
(
0
)
elif
'help'
in
opts
or
'h'
in
opts
:
self
.
die
()
raise
CLI
Error
(
_
(
'No command given'
))
raise
Error
(
_
(
'No command given'
))
cmd_name
=
args
[
0
]
except
ParserError
:
raise
CLI
Error
(
_
(
'Command line parsing error'
))
raise
Error
(
_
(
'Command line parsing error'
))
self
.
command
=
Command
.
get_command
(
cmd_name
,
args
=
orig_args
)
if
not
self
.
command
:
raise
CLI
Error
(
_
(
"Unrecognized command:
%
s"
)
%
cmd_name
)
raise
Error
(
_
(
"Unrecognized command:
%
s"
)
%
cmd_name
)
def
die
(
self
):
printu
(
'
\n
'
+
self
.
parser
.
format_help
())
...
...
scripts/pisish
Dosyayı görüntüle @
b979d52d
...
...
@@ -31,14 +31,14 @@ def exit(retval = 0):
pisi
.
api
.
finalize
()
sys
.
exit
(
retval
)
if
__name__
==
"__main__"
:
locale
.
setlocale
(
locale
.
LC_ALL
,
''
)
print
"""Welcome to the interactive PISI shell.
Type "help" to see a list of commands.
To end the session, type "exit".
Copyright 2006 (c) Pardus
You can run system commands by prefixing with '!' as in '!ls'.
Copyright 2006 (c) Pardus.
"""
while
1
:
cmd
=
raw_input
(
'pisi> '
)
...
...
@@ -58,21 +58,19 @@ Copyright 2006 (c) Pardus
signal
.
signal
(
signal
.
SIGINT
,
signal
.
SIG_IGN
)
# disable further interrupts
ui
=
pisi
.
cli
.
CLI
()
# make a temporary UI
show_traceback
=
False
pisi
.
api
.
finalize
()
if
isinstance
(
value
,
exceptions
.
KeyboardInterrupt
):
ui
.
error
(
_
(
"Keyboard Interrupt: Exiting..."
))
sys
.
exit
(
1
)
elif
isinstance
(
value
,
pisi
.
Error
):
ui
.
error
(
_
(
"Program Terminated."
))
show_traceback
=
ctx
.
get_option
(
'debug'
)
elif
isinstance
(
value
,
db
.
DBRunRecoveryError
):
ui
.
error
(
_
(
"""A database operation has been aborted. You should run pisi
again for normal DB recovery procedure. Make sure you have free disk space.
You have to run rebuild-db only when there is file corruption and database upgrades."""
))
again for normal DB recovery procedure. Make sure you have free disk space.
You have to run rebuild-db only when there is file corruption and database upgrades."""
))
elif
isinstance
(
value
,
pisi
.
Exception
):
show_traceback
=
True
ui
.
error
(
_
(
"""Unhandled internal exception.
Please file a bug report. (http://bugs.uludag.org.tr)"""
))
Please file a bug report. (http://bugs.uludag.org.tr)"""
))
else
:
# For any other exception (possibly Python exceptions) show
# the traceback!
...
...
@@ -84,10 +82,11 @@ Copyright 2006 (c) Pardus
else
:
ui
.
error
(
unicode
(
value
))
ui
.
info
(
_
(
"Please
use 'pisi
help' for general help."
))
ui
.
info
(
_
(
"Please
type '
help' for general help."
))
if
show_traceback
:
ui
.
info
(
_
(
"Traceback:"
))
traceback
.
print_tb
(
tb
)
#traceback.print_exc(file=sys.stdout)
traceback
.
print_tb
(
sys
.
exc_traceback
)
else
:
ui
.
info
(
_
(
"Use --debug to see a traceback."
))
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