* call pisi.finalize before exiting interrupt handler

* PİSİ PİSİ
This commit is contained in:
Eray Özkural
2005-11-22 13:51:01 +00:00
parent d426e302a2
commit c9520cb74a
3 changed files with 32 additions and 26 deletions
+8 -3
View File
@@ -23,13 +23,18 @@ import gettext
__trans = gettext.translation('pisi', fallback=True) __trans = gettext.translation('pisi', fallback=True)
_ = __trans.ugettext _ = __trans.ugettext
def exit():
pisi.api.finalize()
sys.exit(1)
def handle_exception(exception, value, tb): def handle_exception(exception, value, tb):
ui = pisi.cli.CLI() # make a temporary UI ui = pisi.cli.CLI() # make a temporary UI
show_traceback = False show_traceback = False
if exception == exceptions.KeyboardInterrupt: if exception == exceptions.KeyboardInterrupt:
ui.error(_("Keyboard Interrupt: Exiting...")) ui.error(_("Keyboard Interrupt: Exiting..."))
sys.exit(1) exit()
elif isinstance(value, pisi.Error): elif isinstance(value, pisi.Error):
ui.error(_("Fatal Error. Program Terminated.")) ui.error(_("Fatal Error. Program Terminated."))
show_traceback = ctx.get_option('debug') show_traceback = ctx.get_option('debug')
@@ -54,8 +59,8 @@ Please file a bug report. (http://bugs.uludag.org.tr)"""))
else: else:
ui.info(_("Use --debug to see a traceback.")) ui.info(_("Use --debug to see a traceback."))
sys.exit(1) exit()
if __name__ == "__main__": if __name__ == "__main__":
sys.excepthook = handle_exception sys.excepthook = handle_exception
+12 -11
View File
@@ -84,17 +84,18 @@ def init(database = True, options = None, ui = None, comar = True):
ctx.initialized = True ctx.initialized = True
def finalize(): def finalize():
pisi.repodb.finalize() if ctx.initialized:
pisi.installdb.finalize() pisi.repodb.finalize()
if ctx.filesdb != None: pisi.installdb.finalize()
ctx.filesdb.close() if ctx.filesdb != None:
if ctx.componentdb != None: ctx.filesdb.close()
ctx.componentdb.close() if ctx.componentdb != None:
packagedb.finalize_db() ctx.componentdb.close()
pisi.sourcedb.finalize() packagedb.finalize_db()
ctx.ui.debug('PISI API finalized') pisi.sourcedb.finalize()
ctx.ui.close() ctx.ui.debug('PISI API finalized')
ctx.initialized = False ctx.ui.close()
ctx.initialized = False
def list_upgradable(): def list_upgradable():
ignore_build = ctx.config.options and ctx.config.options.ignore_build_no ignore_build = ctx.config.options and ctx.config.options.ignore_build_no
+12 -12
View File
@@ -9,7 +9,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: tr\n" "Project-Id-Version: tr\n"
"POT-Creation-Date: 2005-11-22 15:09+EET\n" "POT-Creation-Date: 2005-11-22 15:09+EET\n"
"PO-Revision-Date: 2005-11-22 15:11+0200\n" "PO-Revision-Date: 2005-11-22 15:53+0200\n"
"Last-Translator: Eray Özkural <eray@uludag.org.tr>\n" "Last-Translator: Eray Özkural <eray@uludag.org.tr>\n"
"Language-Team: Türkçe <tr@li.org>\n" "Language-Team: Türkçe <tr@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@@ -266,7 +266,7 @@ msgstr "Paket %s bulunamadı."
#: pisi/api.py:237 #: pisi/api.py:237
msgid "* Building index of PISI files under %s" msgid "* Building index of PISI files under %s"
msgstr "* %s altındaki PISI dosyalarının bir endeksi yapılıyor." msgstr "* %s altındaki PİSİ dosyalarının bir endeksi yapılıyor."
#: pisi/api.py:240 #: pisi/api.py:240
msgid "* Index file written" msgid "* Index file written"
@@ -430,7 +430,7 @@ msgstr "Yol %s birden çok pakete ait"
#: pisi/build.py:168 #: pisi/build.py:168
msgid "Building PISI source package: %s" msgid "Building PISI source package: %s"
msgstr "PISI kaynak paketi %s inşa ediliyor" msgstr "PİSİ kaynak paketi %s inşa ediliyor"
#: pisi/build.py:208 #: pisi/build.py:208
msgid "IceCream detected. Make sure your daemon is up and running..." msgid "IceCream detected. Make sure your daemon is up and running..."
@@ -569,7 +569,7 @@ msgstr "%s yaratılıyor,"
#: pisi/build.py:626 #: pisi/build.py:626
msgid "Creating PISI package %s." msgid "Creating PISI package %s."
msgstr "PISI paketi %s yaratılıyor." msgstr "PİSİ paketi %s yaratılıyor."
#: pisi/build.py:658 #: pisi/build.py:658
msgid "Done." msgid "Done."
@@ -758,11 +758,11 @@ msgid ""
"You can give a URI of the pspec.xml file. PISI will\n" "You can give a URI of the pspec.xml file. PISI will\n"
"fetch all necessary files and build the package for you.\n" "fetch all necessary files and build the package for you.\n"
msgstr "" msgstr ""
"pspec.xml kullanarak bir PISI paketi inşa et\n" "pspec.xml kullanarak bir PİSİ paketi inşa et\n"
"\n" "\n"
"Kullanım: build <pspec.xml>\n" "Kullanım: build <pspec.xml>\n"
"\n" "\n"
"pspec.xml dosyasının URI'ını verebilirsiniz. PISI sizin\n" "pspec.xml dosyasının URI'ını verebilirsiniz. PİSİ sizin\n"
"için gerekli tüm dosyaları çekip inşa edecektir.\n" "için gerekli tüm dosyaları çekip inşa edecektir.\n"
#: pisi/cli/commands.py:337 #: pisi/cli/commands.py:337
@@ -797,7 +797,7 @@ msgid ""
"You can also specify components instead of package names, which will be\n" "You can also specify components instead of package names, which will be\n"
"expanded to package names.\n" "expanded to package names.\n"
msgstr "" msgstr ""
"PISI paketlerini yükle\n" "PİSİ paketlerini yükle\n"
"\n" "\n"
"Kullanım: install <package1> <package2> ... <packagen>\n" "Kullanım: install <package1> <package2> ... <packagen>\n"
"\n" "\n"
@@ -828,7 +828,7 @@ msgid ""
"You can also specify components instead of package names, which will be\n" "You can also specify components instead of package names, which will be\n"
"expanded to package names.\n" "expanded to package names.\n"
msgstr "" msgstr ""
"PISI paketlerini yükselt\n" "PİSİ paketlerini yükselt\n"
"\n" "\n"
"Kullanım: Upgrade <package1> <package2> ... <packagen>\n" "Kullanım: Upgrade <package1> <package2> ... <packagen>\n"
"\n" "\n"
@@ -852,7 +852,7 @@ msgid ""
"You can also specify components instead of package names, which will be\n" "You can also specify components instead of package names, which will be\n"
"expanded to package names.\n" "expanded to package names.\n"
msgstr "" msgstr ""
"PISI paketlerini kaldır\n" "PİSİ paketlerini kaldır\n"
"\n" "\n"
"Kullanım: remove <package1> <package2> ... <packagen>\n" "Kullanım: remove <package1> <package2> ... <packagen>\n"
"\n" "\n"
@@ -915,11 +915,11 @@ msgid ""
"named by default 'pisi-index.xml'. In particular, it indexes both\n" "named by default 'pisi-index.xml'. In particular, it indexes both\n"
"source and binary packages.\n" "source and binary packages.\n"
msgstr "" msgstr ""
"Verilen bir dizindeki PISI dosyalarının endeksle\n" "Verilen bir dizindeki PİSİ dosyalarının endeksle\n"
"\n" "\n"
"Kullanım: index <directory>\n" "Kullanım: index <directory>\n"
"\n" "\n"
"Bu komut bir dizindeki bütüm PİSİ dosyalarını arastırır, PIS\n" "Bu komut bir dizindeki bütüm PİSİ dosyalarını arastırır, PİSİ\n"
"etiketlerini toplar ve bilgiyi çıktı, varsayılan adı 'pisi-index.xml',olan " "etiketlerini toplar ve bilgiyi çıktı, varsayılan adı 'pisi-index.xml',olan "
"XML dosyasında birleştirir. Özellikle, hem ikili hem kaynak\n" "XML dosyasında birleştirir. Özellikle, hem ikili hem kaynak\n"
"paketlerini endeksler.\n" "paketlerini endeksler.\n"
@@ -1432,7 +1432,7 @@ msgstr ""
#: pisi/lockeddbshelve.py:78 #: pisi/lockeddbshelve.py:78
msgid "Another instance of PISI is running. Try later!" msgid "Another instance of PISI is running. Try later!"
msgstr "PISI bir yerde daha çalışıyor. Yine deneyin!" msgstr "PİSİ bir yerde daha çalışıyor. Yine deneyin!"
#: pisi/metadata.py:58 #: pisi/metadata.py:58
msgid "Build: % s, Distribution: %s, Dist. Release: %s\n" msgid "Build: % s, Distribution: %s, Dist. Release: %s\n"