| 1 | #! /usr/bin/env python |
|---|
| 2 | # -*- coding: utf8 -*- |
|---|
| 3 | # |
|---|
| 4 | # Itaka is free software; you can redistribute it and/or modify |
|---|
| 5 | # it under the terms of the GNU General Public License as published by |
|---|
| 6 | # the Free Software Foundation; either version 2 of the License, or |
|---|
| 7 | # any later version. |
|---|
| 8 | # |
|---|
| 9 | # Itaka is distributed in the hope that it will be useful, |
|---|
| 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 12 | # GNU General Public License for more details. |
|---|
| 13 | # |
|---|
| 14 | # You should have received a copy of the GNU General Public License |
|---|
| 15 | # along with Itaka; if not, write to the Free Software |
|---|
| 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
|---|
| 17 | # |
|---|
| 18 | # Copyright 2003-2007 Marc E. <santusmarc@gmail.com>. |
|---|
| 19 | # http://itaka.jardinpresente.com.ar |
|---|
| 20 | # |
|---|
| 21 | # $Id: itaka.py 124 2007-06-06 05:39:18Z marc $ |
|---|
| 22 | |
|---|
| 23 | """ Itaka main loader core """ |
|---|
| 24 | |
|---|
| 25 | import sys, traceback |
|---|
| 26 | |
|---|
| 27 | # Itaka core modules |
|---|
| 28 | try: |
|---|
| 29 | # Initiate our Console and Configuration engines |
|---|
| 30 | import console |
|---|
| 31 | import config as itakaglobals |
|---|
| 32 | configinstance = itakaglobals.ConfigParser() |
|---|
| 33 | configinstance.load() |
|---|
| 34 | |
|---|
| 35 | try: |
|---|
| 36 | # Initiate console with a reference to our global configuration values |
|---|
| 37 | console = console.Console(itakaglobals) |
|---|
| 38 | except AttributeError: |
|---|
| 39 | print "[*] ERROR: Could not initiate Console engine." |
|---|
| 40 | traceback.print_exc() |
|---|
| 41 | sys.exit(1) |
|---|
| 42 | |
|---|
| 43 | import uigtk as igui |
|---|
| 44 | |
|---|
| 45 | except ImportError: |
|---|
| 46 | print "[*] ERROR: Failed to import Itaka modules." |
|---|
| 47 | traceback.print_exc() |
|---|
| 48 | sys.exit(1) |
|---|
| 49 | |
|---|
| 50 | if __name__ == "__main__": |
|---|
| 51 | try: |
|---|
| 52 | gui = igui.Gui(console, (itakaglobals, configinstance)) |
|---|
| 53 | gui.main() |
|---|
| 54 | except AttributeError: |
|---|
| 55 | console.error(('Itaka', 'core'), "Could not initiate GUI") |
|---|
| 56 | traceback.print_exc() |
|---|
| 57 | sys.exit(1) |
|---|