source: tags/0.2/itaka.py @ 335

Revision 173, 2.1 KB checked in by marc, 5 years ago (diff)

Dont hide server log on stopping server. Fixed minor UI quirk when starting/stopping server. Removed redundant gtk.Hbox. Removed my email from all files. Added references to the HACKING guide on the docs.

  • Property svn:executable set to *
  • Property svn:keywords set to Id Rev
Line 
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.
19# http://itaka.jardinpresente.com.ar
20#
21# $Id$
22
23""" Itaka core """
24
25import sys, traceback
26
27validarguments = ('-help', '-debug')
28arguments = sys.argv
29
30# Only one option at a time
31if len(arguments) > 2 or (len(arguments) == 2 and arguments[-1] not in validarguments or arguments[-1] == validarguments[0]):
32    print "Usage: %s (-debug|-help)" % (arguments[0])
33    sys.exit(1)
34elif len(arguments) == 1:
35    arguments = None
36
37# Itaka core modules
38try:
39    # Initiate our Console and Configuration engines
40    import console
41    import config as itakaglobals
42    configinstance = itakaglobals.ConfigParser(arguments)
43    configinstance.load()
44
45    try:
46        # Initiate console with a reference to our global configuration values
47        console = console.Console(itakaglobals)
48    except:
49        print "[*] ERROR: Could not initiate Console engine"
50        traceback.print_exc()
51        sys.exit(1)
52
53    import uigtk as igui
54except ImportError:
55    print "[*] ERROR: Failed to import Itaka modules"
56    if itakaglobals.output['debug']:
57        traceback.print_exc()
58    sys.exit(1)
59
60if __name__ == "__main__":
61    try:
62        gui = igui.Gui(console, (itakaglobals, configinstance))
63        gui.main()
64    except Exception, e:
65        console.failure(('Itaka', 'core'), "Could not initiate GUI: %s" % (e), 'ERROR')
66        if itakaglobals.output['debug']:
67            traceback.print_exc()
68        sys.exit(1)
Note: See TracBrowser for help on using the repository browser.