47950a019c
- yeni context'in kullanılmasını sağla (kod çalışsın diye, context'i bu şekilde bırakmak güzel bir kod oluşturmuyor). - düzeltirken hatırlamadığım onlarca hata...
54 lines
1.1 KiB
Python
Executable File
54 lines
1.1 KiB
Python
Executable File
#!/usr/bin/python
|
|
#
|
|
# Copyright (C) 2005, TUBITAK/UEKAE
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify it under
|
|
# the terms of the GNU General Public License as published by the Free
|
|
# Software Foundation; either version 2 of the License, or (at your option)
|
|
# any later version.
|
|
#
|
|
# Please read the COPYING file.
|
|
#
|
|
|
|
import sys
|
|
|
|
import gettext
|
|
__trans = gettext.translation('pisi', fallback=True)
|
|
_ = __trans.ugettext
|
|
|
|
from pisi.cli.pisicli import PisiCLI
|
|
|
|
def handle_exception(exception, value, tb):
|
|
import traceback
|
|
import exceptions
|
|
|
|
import pisi.ui
|
|
from pisi.xmlext import XmlError
|
|
|
|
ui = pisi.ui.CLI()
|
|
|
|
if exception == exceptions.KeyboardInterrupt:
|
|
ui.error(_("\nKeyboardInterrupt: Exiting...\n"))
|
|
sys.exit(1)
|
|
elif exception == XmlError:
|
|
ui.error(str(value))
|
|
sys.exit(1)
|
|
|
|
ui.error(_("""
|
|
Internal PISI Error:
|
|
Please file a bug report! (http://bugs.uludag.org.tr)
|
|
|
|
"""))
|
|
|
|
ui.error("%s\n" %value)
|
|
ui.info(_("Traceback:\n"))
|
|
traceback.print_tb(tb)
|
|
sys.exit(1)
|
|
|
|
if __name__ == "__main__":
|
|
|
|
sys.excepthook = handle_exception
|
|
|
|
cli = PisiCLI()
|
|
cli.run_command()
|