source: trunk/lome_new.py @ 2290

Revision 945, 2.2 KB checked in by dart, 3 years ago (diff)

LotATC:
o adaptation for maemo

Line 
1# -*- coding: utf-8 -*-
2# vim: ts=4:sw=4
3#    This file is part of LOME.
4#
5#    LOME is free software: you can redistribute it and/or modify
6#    it under the terms of the GNU General Public License as published by
7#    the Free Software Foundation, either version 3 of the License, or
8#    (at your option) any later version.
9#
10#    LOME is distributed in the hope that it will be useful,
11#    but WITHOUT ANY WARRANTY; without even the implied warranty of
12#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13#    GNU General Public License for more details.
14#
15#    You should have received a copy of the GNU General Public License
16#    along with LOME.  If not, see <http://www.gnu.org/licenses/>.
17#
18
19# @ Main LOME entry
20# Launch LOME
21import sys,os,logging,traceback
22sys.path.append(os.path.join(sys.path[0],'common'))
23sys.path.append(os.path.join(sys.path[0],'common','misabstractlayer'))
24sys.path.append(os.path.join(sys.path[0],'lome_new'))
25from PyQt4.QtGui import *
26from lomewnd import *
27from debug import *
28from constants import *
29
30try:
31    import logging.config
32    # Set logging config
33    logging.config.fileConfig('logging.conf')
34except:
35    # Set logging config
36    logging.basicConfig(level=logging.WARNING, format='%(name)s: %(message)s'
37            ,filename='lome.log', filemode='w'
38            )
39
40if __name__ == "__main__":
41    #try:
42    #    pathname = dirname( __file__ )
43    #except:
44    #    pathname = dirname( sys.argv[0] )
45    pathname = os.path.abspath(dirname( sys.argv[0] ))
46    app = QApplication(sys.argv)
47
48    #- Load traduction
49    locale = QLocale.system().name();
50   
51    #-Debug
52    #locale = "fr_FR"
53    #locale = "hr_HR"
54   
55    translator = QTranslator()
56    translator.load(QString("lome_"+locale), QString(os.path.join(pathname, "i18n")))
57    app.installTranslator(translator);
58   
59    cst_init( app )
60
61    try:
62        window = LomeWnd(pathname)
63
64        window.show()
65        sys.exit(app.exec_())   
66    except SystemExit:
67        pass
68    except:
69        exceptionType, exceptionValue, exceptionTraceback = sys.exc_info()
70        msg_a = traceback.format_exception(exceptionType, exceptionValue, exceptionTraceback)
71        msg = ""
72        for m in msg_a:
73            msg += m
74        logging.getLogger('[ERROR]').debug(msg)
Note: See TracBrowser for help on using the repository browser.