* sen de git.
This commit is contained in:
@@ -75,7 +75,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
locale.setlocale(locale.LC_ALL, '')
|
locale.setlocale(locale.LC_ALL, '')
|
||||||
cli = pisicli.PisiCLI()
|
cli = pisicli.PisiCLI()
|
||||||
try:
|
cli.run_command()
|
||||||
cli.run_command()
|
|
||||||
except pisi.operations.PisiUpgradeException, e:
|
|
||||||
print _('PISI has been upgraded.')
|
|
||||||
|
|||||||
@@ -38,12 +38,6 @@ from pisi.version import Version
|
|||||||
class Error(pisi.Error):
|
class Error(pisi.Error):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class PisiUpgradeException(pisi.Exception):
|
|
||||||
"""application must reload all pisi modules it imported after receiving
|
|
||||||
this exception"""
|
|
||||||
def __init__(self):
|
|
||||||
pisi.Exception.__init__(self, _("Upgrading PISI requires database rebuild and restart"))
|
|
||||||
|
|
||||||
def upgrade_pisi():
|
def upgrade_pisi():
|
||||||
"""forces to reload pisi modules and runs rebuild-db if needed."""
|
"""forces to reload pisi modules and runs rebuild-db if needed."""
|
||||||
|
|
||||||
@@ -74,7 +68,6 @@ def upgrade_pisi():
|
|||||||
reload_pisi()
|
reload_pisi()
|
||||||
rebuild_db()
|
rebuild_db()
|
||||||
pisi.api.init()
|
pisi.api.init()
|
||||||
raise PisiUpgradeException()
|
|
||||||
|
|
||||||
# high level operations
|
# high level operations
|
||||||
|
|
||||||
|
|||||||
@@ -52,8 +52,6 @@ Copyright 2006 (c) Pardus.
|
|||||||
try:
|
try:
|
||||||
cli = PisiCLI(cmd.split())
|
cli = PisiCLI(cmd.split())
|
||||||
cli.run_command()
|
cli.run_command()
|
||||||
except pisi.operations.PisiUpgradeException, e:
|
|
||||||
print _('PISI has been upgraded.')
|
|
||||||
except Exception, value:
|
except Exception, value:
|
||||||
signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts
|
signal.signal(signal.SIGINT, signal.SIG_IGN) # disable further interrupts
|
||||||
ui = pisi.cli.CLI() # make a temporary UI
|
ui = pisi.cli.CLI() # make a temporary UI
|
||||||
|
|||||||
Reference in New Issue
Block a user