#!/usr/bin/env python #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # # QGISLite - An Open Source GIS tool based on the QGIS core libraries # and written in Python # # Copyright (C) 2009 Aaron Racicot, Z-Pulley Inc. # # EMAIL: aaronr (at) z-pulley.com # WEB : http://www.reprojected.com # TRAC : http://trac.reprojected.com/qgislite # SVN : http://svn.reprojected.com/qgislite # #-------------------------------------------------------------------------- #-------------------------------------------------------------------------- # # licensed under the terms of GNU GPL 2 # # 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # #-------------------------------------------------------------------------- # PyQt4 includes for python bindings to QT from PyQt4.QtCore import QString,SIGNAL,SLOT from PyQt4.QtGui import QApplication # Main QGISLite GUI from core.qgislite_gui import QGISLiteGui # General system includes import sys,time def initApp(QGISLite): # Set the app style QGISLite.setStyle(QString("plastique")) qgis_is_configured = False try: # QGIS bindings for mapping functions import qgis.core # Path to local QGIS install qgis_prefix = "/usr/local/qgis_svn" # initialize qgis libraries qgis.core.QgsApplication.setPrefixPath(qgis_prefix, True) qgis.core.QgsApplication.initQgis() qgis_is_configured = True except ImportError: print "Unable to import QGIS" # Create signal for app finish QGISLite.connect(QGISLite, SIGNAL("lastWindowClosed()"), QGISLite, SLOT("quit()")) # create main window window = QGISLiteGui() window.show() # Start up QGISLite retval = QGISLite.exec_() if qgis_is_configured == True: qgis.core.QgsApplication.exitQgis() return retval # Main QGISLite entry def main(argv): # create Qt application QGISLite = QApplication(argv,True) retval = initApp(QGISLite) sys.exit(retval) if __name__ == "__main__": main(sys.argv)