From c9520cb74af15fd8b0bb1c2c229b7397b21301f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Tue, 22 Nov 2005 13:51:01 +0000 Subject: [PATCH] =?UTF-8?q?*=20call=20pisi.finalize=20before=20exiting=20i?= =?UTF-8?q?nterrupt=20handler=20*=20P=C4=B0S=C4=B0=20P=C4=B0S=C4=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pisi-cli | 11 ++++++++--- pisi/api.py | 23 ++++++++++++----------- po/tr.po | 24 ++++++++++++------------ 3 files changed, 32 insertions(+), 26 deletions(-) diff --git a/pisi-cli b/pisi-cli index 8ce0233f..0ca10ea0 100755 --- a/pisi-cli +++ b/pisi-cli @@ -23,13 +23,18 @@ import gettext __trans = gettext.translation('pisi', fallback=True) _ = __trans.ugettext + +def exit(): + pisi.api.finalize() + sys.exit(1) + def handle_exception(exception, value, tb): ui = pisi.cli.CLI() # make a temporary UI show_traceback = False if exception == exceptions.KeyboardInterrupt: ui.error(_("Keyboard Interrupt: Exiting...")) - sys.exit(1) + exit() elif isinstance(value, pisi.Error): ui.error(_("Fatal Error. Program Terminated.")) show_traceback = ctx.get_option('debug') @@ -54,8 +59,8 @@ Please file a bug report. (http://bugs.uludag.org.tr)""")) else: ui.info(_("Use --debug to see a traceback.")) - sys.exit(1) - + exit() + if __name__ == "__main__": sys.excepthook = handle_exception diff --git a/pisi/api.py b/pisi/api.py index a9548b77..0f7f4c3f 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -84,17 +84,18 @@ def init(database = True, options = None, ui = None, comar = True): ctx.initialized = True def finalize(): - pisi.repodb.finalize() - pisi.installdb.finalize() - if ctx.filesdb != None: - ctx.filesdb.close() - if ctx.componentdb != None: - ctx.componentdb.close() - packagedb.finalize_db() - pisi.sourcedb.finalize() - ctx.ui.debug('PISI API finalized') - ctx.ui.close() - ctx.initialized = False + if ctx.initialized: + pisi.repodb.finalize() + pisi.installdb.finalize() + if ctx.filesdb != None: + ctx.filesdb.close() + if ctx.componentdb != None: + ctx.componentdb.close() + packagedb.finalize_db() + pisi.sourcedb.finalize() + ctx.ui.debug('PISI API finalized') + ctx.ui.close() + ctx.initialized = False def list_upgradable(): ignore_build = ctx.config.options and ctx.config.options.ignore_build_no diff --git a/po/tr.po b/po/tr.po index 48660136..e9f2adcd 100644 --- a/po/tr.po +++ b/po/tr.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: tr\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 \n" "Language-Team: Türkçe \n" "MIME-Version: 1.0\n" @@ -266,7 +266,7 @@ msgstr "Paket %s bulunamadı." #: pisi/api.py:237 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 msgid "* Index file written" @@ -430,7 +430,7 @@ msgstr "Yol %s birden çok pakete ait" #: pisi/build.py:168 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 msgid "IceCream detected. Make sure your daemon is up and running..." @@ -569,7 +569,7 @@ msgstr "%s yaratılıyor," #: pisi/build.py:626 msgid "Creating PISI package %s." -msgstr "PISI paketi %s yaratılıyor." +msgstr "PİSİ paketi %s yaratılıyor." #: pisi/build.py:658 msgid "Done." @@ -758,11 +758,11 @@ msgid "" "You can give a URI of the pspec.xml file. PISI will\n" "fetch all necessary files and build the package for you.\n" msgstr "" -"pspec.xml kullanarak bir PISI paketi inşa et\n" +"pspec.xml kullanarak bir PİSİ paketi inşa et\n" "\n" "Kullanım: build \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" #: pisi/cli/commands.py:337 @@ -797,7 +797,7 @@ msgid "" "You can also specify components instead of package names, which will be\n" "expanded to package names.\n" msgstr "" -"PISI paketlerini yükle\n" +"PİSİ paketlerini yükle\n" "\n" "Kullanım: install ... \n" "\n" @@ -828,7 +828,7 @@ msgid "" "You can also specify components instead of package names, which will be\n" "expanded to package names.\n" msgstr "" -"PISI paketlerini yükselt\n" +"PİSİ paketlerini yükselt\n" "\n" "Kullanım: Upgrade ... \n" "\n" @@ -852,7 +852,7 @@ msgid "" "You can also specify components instead of package names, which will be\n" "expanded to package names.\n" msgstr "" -"PISI paketlerini kaldır\n" +"PİSİ paketlerini kaldır\n" "\n" "Kullanım: remove ... \n" "\n" @@ -915,11 +915,11 @@ msgid "" "named by default 'pisi-index.xml'. In particular, it indexes both\n" "source and binary packages.\n" msgstr "" -"Verilen bir dizindeki PISI dosyalarının endeksle\n" +"Verilen bir dizindeki PİSİ dosyalarının endeksle\n" "\n" "Kullanım: index \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 " "XML dosyasında birleştirir. Özellikle, hem ikili hem kaynak\n" "paketlerini endeksler.\n" @@ -1432,7 +1432,7 @@ msgstr "" #: pisi/lockeddbshelve.py:78 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 msgid "Build: % s, Distribution: %s, Dist. Release: %s\n"