conduit r1337 - in trunk: . conduit conduit/gtkui conduit/hildonui conduit/modules/GmailModule conduit/modules/NetworkModule



Author: jstowers
Date: Tue Feb 26 12:43:50 2008
New Revision: 1337
URL: http://svn.gnome.org/viewvc/conduit?rev=1337&view=rev

Log:
2008-02-27  John Stowers  <john stowers gmail com>

	* conduit/Main.py:
	* conduit/SyncSet.py:
	* conduit/__init__.py:
	* conduit/defs.py.in:
	* conduit/gtkui/UI.py:
	* conduit/hildonui/UI.py:
	* conduit/modules/GmailModule/GmailModule.py:
	* conduit/modules/NetworkModule/Peers.py:
	* configure.ac: Removed some unused autoconf expansions in defs.py.in
	s/conduit.APPVERSION/conduit.VERSION/ and replace Conduit.APPNAME with
	a hardcoded 'Conduit'. Remove gnome.init and gnome.help_display and just 
	open a ghelp URI directly (makes help work when uninstalled)



Modified:
   trunk/ChangeLog
   trunk/conduit/Main.py
   trunk/conduit/SyncSet.py
   trunk/conduit/__init__.py
   trunk/conduit/defs.py.in
   trunk/conduit/gtkui/UI.py
   trunk/conduit/hildonui/UI.py
   trunk/conduit/modules/GmailModule/GmailModule.py
   trunk/conduit/modules/NetworkModule/Peers.py
   trunk/configure.ac

Modified: trunk/conduit/Main.py
==============================================================================
--- trunk/conduit/Main.py	(original)
+++ trunk/conduit/Main.py	Tue Feb 26 12:43:50 2008
@@ -35,12 +35,11 @@
         self.gui = None
         self.statusIcon = None
         self.dbus = None
-
         self.guiSyncSet = None
         self.dbusSyncSet = None
-        
         self.uiLib = None
 
+        gobject.set_application_name("Conduit")
         #Default command line values
         if conduit.IS_DEVELOPMENT_VERSION:
             self.settingsFile = os.path.join(conduit.USER_DIR, "settings-dev.xml")
@@ -61,7 +60,7 @@
                     self._usage()
                     sys.exit(0)
                 if o in ("-v", "--version"):
-                    print "%s %s" % (conduit.APPNAME, conduit.APPVERSION)
+                    print "Conduit %s" % conduit.VERSION
                     sys.exit(0)
                 if o in ("-s", "--settings"):
                      self.settingsFile = os.path.join(os.getcwd(), a)
@@ -76,7 +75,7 @@
             self._usage()
             sys.exit(1)
 
-        log.info("Conduit v%s Installed: %s" % (conduit.APPVERSION, conduit.IS_INSTALLED))
+        log.info("Conduit v%s Installed: %s" % (conduit.VERSION, conduit.IS_INSTALLED))
         log.info("Using UI: %s" % self.ui)
         
         #Make conduit single instance. If conduit is already running then

Modified: trunk/conduit/SyncSet.py
==============================================================================
--- trunk/conduit/SyncSet.py	(original)
+++ trunk/conduit/SyncSet.py	Tue Feb 26 12:43:50 2008
@@ -123,7 +123,7 @@
         #Build the application settings xml document
         doc = xml.dom.minidom.Document()
         rootxml = doc.createElement("conduit-application")
-        rootxml.setAttribute("version", conduit.APPVERSION)
+        rootxml.setAttribute("version", conduit.VERSION)
         doc.appendChild(rootxml)
         
         #Store the conduits
@@ -189,7 +189,7 @@
             doc = xml.dom.minidom.parse(xmlSettingFilePath)
             xmlVersion = doc.documentElement.getAttribute("version")
             #And check it is the correct version        
-            if xmlVersion != conduit.APPVERSION:
+            if xmlVersion != conduit.VERSION:
                 log.info("%s xml file is incorrect version" % xmlSettingFilePath)
                 os.remove(xmlSettingFilePath)
                 return

Modified: trunk/conduit/__init__.py
==============================================================================
--- trunk/conduit/__init__.py	(original)
+++ trunk/conduit/__init__.py	Tue Feb 26 12:43:50 2008
@@ -28,8 +28,8 @@
 ################################################################################
 # Global Constants
 ################################################################################
-_dirname = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
-IS_INSTALLED = not os.path.exists(os.path.join(_dirname,"ChangeLog"))
+DIRECTORY = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
+IS_INSTALLED = not os.path.exists(os.path.join(DIRECTORY,"ChangeLog"))
 IS_DEVELOPMENT_VERSION = True
 
 # Check the profile directory to prevent crashes when saving settings, etc
@@ -42,12 +42,11 @@
     if not PYTHONDIR in sys.path:
         sys.path.insert(0, PYTHONDIR)
 else:
-    APPNAME =                   "Conduit"
-    APPVERSION =                "0.3.9"
-    LOCALE_DIR =                os.path.join(_dirname, "po")
-    SHARED_DATA_DIR =           os.path.join(_dirname, "data")
-    GLADE_FILE =                os.path.join(_dirname, "data","conduit.glade")
-    SHARED_MODULE_DIR =         os.path.join(_dirname, "conduit", "modules")
+    VERSION =                   "0.3.9"
+    LOCALE_DIR =                os.path.join(DIRECTORY, "po")
+    SHARED_DATA_DIR =           os.path.join(DIRECTORY, "data")
+    GLADE_FILE =                os.path.join(DIRECTORY, "data","conduit.glade")
+    SHARED_MODULE_DIR =         os.path.join(DIRECTORY, "conduit", "modules")
 
 import Globals
 GLOBALS = Globals.Globals()

Modified: trunk/conduit/defs.py.in
==============================================================================
--- trunk/conduit/defs.py.in	(original)
+++ trunk/conduit/defs.py.in	Tue Feb 26 12:43:50 2008
@@ -1,12 +1,9 @@
-APPVERSION = "@VERSION@"
-APPNAME = "@PACKAGE@"
+VERSION = "@VERSION@"
 PYTHONDIR = "@PYTHONDIR@"
+BIN_DIR = "@BINDIR@"
+LIB_DIR = "@LIBDIR@"
 LOCALE_DIR = "@LOCALEDIR@"
 SHARED_DATA_DIR = "@PKGDATADIR@"
 SHARED_MODULE_DIR = "@MODULEDIR@"
 
-BIN_DIR = "@BINDIR@"
-DATA_DIR = "@DATADIR@"
-LIB_DIR = "@LIBDIR@"
-
 

Modified: trunk/conduit/gtkui/UI.py
==============================================================================
--- trunk/conduit/gtkui/UI.py	(original)
+++ trunk/conduit/gtkui/UI.py	Tue Feb 26 12:43:50 2008
@@ -48,7 +48,6 @@
         Constructs the mainwindow. Throws up a splash screen to cover 
         the most time consuming pieces
         """
-        gnome.init(conduit.APPNAME, conduit.APPVERSION, properties={gnome.PARAM_APP_DATADIR:'/usr/share'})
         gnome.ui.authentication_manager_init()        
 
         self.conduitApplication = conduitApplication
@@ -96,9 +95,9 @@
                 gtk.widget_set_default_colormap(colormap)
         self.mainWindow.set_position(gtk.WIN_POS_CENTER)
         self.mainWindow.set_icon_name("conduit")
-        title = "%s" % conduit.APPNAME
+        title = "Conduit"
         if conduit.IS_DEVELOPMENT_VERSION:
-            title = title + " - %s (Development Version)" % conduit.APPVERSION
+            title = title + " - %s (Development Version)" % conduit.VERSION
         if not conduit.IS_INSTALLED:
             title = title + " - Running Uninstalled"
         self.mainWindow.set_title(title)
@@ -383,7 +382,16 @@
         """
         Display help
         """
-        gnome.help_display(conduit.APPNAME, None)
+        if conduit.IS_INSTALLED:
+            uri = "ghelp:conduit"
+        else:
+            #if we are not installed then launch the ghelp uri with a full path
+            uri = "ghelp:%s" % os.path.join(conduit.DIRECTORY,"help","C","conduit.xml")
+        log.debug("Launching help: %s" % uri)
+        gobject.spawn_async(
+                    argv=("xdg-open",uri),
+                    flags=gobject.SPAWN_SEARCH_PATH | gobject.SPAWN_STDOUT_TO_DEV_NULL | gobject.SPAWN_STDERR_TO_DEV_NULL
+                    )
 
     def on_window_state_event(self, widget, event):
         visible = self.is_visible()
@@ -532,8 +540,8 @@
 class AboutDialog(gtk.AboutDialog):
     def __init__(self):
         gtk.AboutDialog.__init__(self)
-        self.set_name(conduit.APPNAME)
-        self.set_version(conduit.APPVERSION)
+        self.set_name("Conduit")
+        self.set_version(conduit.VERSION)
         self.set_comments("Synchronisation for GNOME")
         self.set_website("http://www.conduit-project.org";)
         self.set_authors([

Modified: trunk/conduit/hildonui/UI.py
==============================================================================
--- trunk/conduit/hildonui/UI.py	(original)
+++ trunk/conduit/hildonui/UI.py	Tue Feb 26 12:43:50 2008
@@ -64,7 +64,7 @@
         main_pane.add1(self.provider_box)
         main_pane.add2(self.canvas)
         self.mainWindow.add(main_pane)
-        gobject.set_application_name(conduit.APPNAME)
+        gobject.set_application_name("Conduit")
 
     def set_model(self, syncSet):
         self.syncSet = syncSet

Modified: trunk/conduit/modules/GmailModule/GmailModule.py
==============================================================================
--- trunk/conduit/modules/GmailModule/GmailModule.py	(original)
+++ trunk/conduit/modules/GmailModule/GmailModule.py	Tue Feb 26 12:43:50 2008
@@ -85,7 +85,7 @@
         DataProvider.TwoWay.__init__(self)
 
         #What emails should the source return??
-        self.saveWithLabel = "%s-%s" % (conduit.APPNAME,conduit.APPVERSION)
+        self.saveWithLabel = "Conduit-%s" % conduit.VERSION
         self.getAllEmail = False
         self.getUnreadEmail = False
         self.getWithLabel = ""

Modified: trunk/conduit/modules/NetworkModule/Peers.py
==============================================================================
--- trunk/conduit/modules/NetworkModule/Peers.py	(original)
+++ trunk/conduit/modules/NetworkModule/Peers.py	Tue Feb 26 12:43:50 2008
@@ -165,7 +165,7 @@
                 AVAHI_SERVICE_DOMAIN,   #domain
                 '',                     #host
                 self.port,              #port
-                string_array_to_txt_array(["version=%s" % conduit.APPVERSION])
+                string_array_to_txt_array(["version=%s" % conduit.VERSION])
                 )
         self.group.Commit()
             
@@ -243,7 +243,7 @@
 
         # Check if the service is local and then check the 
         # conduit versions are identical
-        if extra.has_key("version") and extra["version"] == conduit.APPVERSION:
+        if extra.has_key("version") and extra["version"] == conduit.VERSION:
             self.detected_cb(str(name), str(host), str(address), str(port), extra_info)
         else:
             log.debug("Ignoring %s because remote conduit is different version" % name)

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Tue Feb 26 12:43:50 2008
@@ -94,13 +94,12 @@
 AC_SUBST(VERSION)
 AC_SUBST(PACKAGE)
 
+AS_AC_EXPAND(PYTHONDIR, $pythondir)
+AS_AC_EXPAND(BINDIR, $bindir)
+AS_AC_EXPAND(LIBDIR, $libdir)
 AS_AC_EXPAND(LOCALEDIR, $localedir)
 AS_AC_EXPAND(PKGDATADIR, $datarootdir/$PACKAGE)
-AS_AC_EXPAND(ICONDIR, $datarootdir/$PACKAGE/icons)
-AS_AC_EXPAND(LIBDIR, $libdir)
 AS_AC_EXPAND(MODULEDIR, $libdir/$PACKAGE/modules)
-AS_AC_EXPAND(PYTHONDIR, $pythondir)
-AS_AC_EXPAND(BINDIR, $bindir)
 
 ################################################################################
 #-------------------------------------------------------------------------------



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]