From: <dg...@us...> - 2011-06-29 11:57:32
|
Revision: 809 http://pytrainer.svn.sourceforge.net/pytrainer/?rev=809&view=rev Author: dgranda Date: 2011-06-29 11:57:25 +0000 (Wed, 29 Jun 2011) Log Message: ----------- Ticket #131 - Moving from GtkMozEmbed to WebKit. Thx to cperrier Modified Paths: -------------- pytrainer/trunk/INSTALL pytrainer/trunk/bin/pytrainer pytrainer/trunk/pytrainer/extensions/googlemaps.py pytrainer/trunk/pytrainer/extensions/mapviewer.py pytrainer/trunk/pytrainer/extensions/osm.py pytrainer/trunk/pytrainer/extensions/waypointeditor.py pytrainer/trunk/pytrainer/main.py Modified: pytrainer/trunk/INSTALL =================================================================== --- pytrainer/trunk/INSTALL 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/INSTALL 2011-06-29 11:57:25 UTC (rev 809) @@ -7,23 +7,22 @@ Here you are dependencies for PyTrainer. Of course you must have a working environment with proper shell configuration and typical GNU tools to uncompress (gunzip) and untar (tar) files. -1.1.- Packages (Fedora 12 working versions as of 2010.03.03 for 1.7.2 dev) +1.1.- Packages (Fedora 14 working versions as of 2011.06.28 for 1.8.1) -python-2.6.2 -python-devel-2.6.2 (to run installation from tarball) -python-matplotlib-0.98.5.2 +python-2.7.8 +python-devel-2.7.8 (to run installation from tarball) +python-matplotlib-1.0.1 python-dateutil-1.4.1 -gnome-python2-gtkmozembed-2.25.3 -pygtk2-libglade-2.16.0 -pygtk2-2.16.0 +pywebkitgtk-1.1.6-5 (see ticket #131) +pygtk2-libglade-2.17.0 +pygtk2-2.17.0 SOAPpy-0.11.6 -python-lxml-2.2.3 -libxml2-python-2.7.6 -libxml2-2.7.6 +python-lxml-2.2.8 +libxml2-python-2.7.7 +libxml2-2.7.7 libxslt-python-1.1.26 libxslt-1.1.26 -sqlite-3.6.20 (sqlite is preferred as db than mysql) -xulrunner-1.9.1.8 +sqlite-3.6.23 (sqlite is preferred as db than mysql, MySQL-python has been reported to be installed if so) - Only needed if correspondent plugin is enabled: gpsbabel-1.3.5 ("Garmin via GPSBabel 1.3.5" aka garmin_hr) Modified: pytrainer/trunk/bin/pytrainer =================================================================== --- pytrainer/trunk/bin/pytrainer 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/bin/pytrainer 2011-06-29 11:57:25 UTC (rev 809) @@ -95,25 +95,6 @@ sys.path.insert(0, site_path) from pytrainer.main import pyTrainer -#Determine xulrunner location -xulrunners = glob.glob("/usr/li*/xulrunner*/xulrunner") -if len(xulrunners) == 0: - #Didnt find any - fall back to old approach - xul_env = commands.getstatusoutput("find /usr/li* -name xulrunner -exec dirname {} \; 2>/dev/null")[1] -elif len(xulrunners) == 1: - #Found just one location - use that - xul_env = os.path.dirname(xulrunners[0]) -else: - #Found more than one - need to choose one... - max_version = None - for item in xulrunners: - xul_dir = os.path.dirname(item) - max_version = _max(max_version, xul_dir) - xul_env = max_version - -print "Using xulrunner dir: %s" % xul_env -os.environ['MOZILLA_FIVE_HOME'] = xul_env - def main(): pytrainer = pyTrainer(None, data_path) Modified: pytrainer/trunk/pytrainer/extensions/googlemaps.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/googlemaps.py 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/pytrainer/extensions/googlemaps.py 2011-06-29 11:57:25 UTC (rev 809) @@ -65,9 +65,7 @@ def drawMap(self,activity, linetype): '''Draw google map create html file using Google API version3 - render using embedded Mozilla - - info at http://www.pygtk.org/pygtkmozembed/class-gtkmozembed.html + render using embedded Webkit ''' logging.debug(">>") points = [] Modified: pytrainer/trunk/pytrainer/extensions/mapviewer.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/mapviewer.py 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/pytrainer/extensions/mapviewer.py 2011-06-29 11:57:25 UTC (rev 809) @@ -16,7 +16,7 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import gtkmozembed +import webkit import logging import os @@ -31,14 +31,13 @@ logging.debug("Display box (%s) is None" % ( str(box))) return self.box = box - gtkmozembed.set_profile_path("/tmp", "foobar") # http://faq.pygtk.org/index.py?req=show&file=faq19.018.htp #TODO FIX??? - self.moz = gtkmozembed.MozEmbed() + self.wkview = webkit.WebView() self.pack_box() logging.debug("<<") def pack_box(self): logging.debug(">>") - self.box.pack_start(self.moz, True, True) + self.box.pack_start(self.wkview, True, True) self.box.show_all() logging.debug("<<") @@ -46,7 +45,7 @@ logging.debug(">>") if htmlfile is None: htmlfile = self.createErrorHtml() - self.moz.load_url("file://%s" % (htmlfile)) + self.wkview.load_uri("file://%s" % (htmlfile)) #self.box.show_all() logging.debug("<<") Modified: pytrainer/trunk/pytrainer/extensions/osm.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/osm.py 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/pytrainer/extensions/osm.py 2011-06-29 11:57:25 UTC (rev 809) @@ -3,7 +3,6 @@ # TODO: Add Google satellite images layers ? # TODO: Create map class/interface that osm/googlemaps will inherit from ? -import gtkmozembed # embedded mozilla import os import re import logging @@ -78,9 +77,7 @@ def drawMap(self, activity, linetype): '''Draw OSM map create HTML file using Open Layers and Open Street Map - render using embedded Mozilla - - info at http://www.pygtk.org/pygtkmozembed/class-gtkmozembed.html + render using embedded Webkit ''' logging.debug(">>") points = [] Modified: pytrainer/trunk/pytrainer/extensions/waypointeditor.py =================================================================== --- pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/pytrainer/extensions/waypointeditor.py 2011-06-29 11:57:25 UTC (rev 809) @@ -16,7 +16,7 @@ #along with this program; if not, write to the Free Software #Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -import gtkmozembed +import webkit import os import re @@ -33,9 +33,9 @@ logging.debug(">>") self.data_path = data_path self.extension = Extension() - self.moz = gtkmozembed.MozEmbed() - self.moz.connect('title', self.handle_title_changed) - vbox.pack_start(self.moz, True, True) + self.wkview = webkit.WebView() + self.wkview.connect('notify::title', self.handle_title_changed) + vbox.pack_start(self.wkview, True, True) vbox.show_all() self.htmlfile = "" self.waypoint=waypoint @@ -43,7 +43,9 @@ logging.debug("<<") def handle_title_changed(self, *args): - title = self.moz.get_title() + title = self.wkview.get_title() + if title == None: + return logging.debug("Received title: "+ title) m = re.match("call:([a-zA-Z]*)[(](.*)[)]", title) if m: @@ -86,7 +88,7 @@ tmpdir = self.pytrainer_main.profile.tmpdir htmlfile = tmpdir+"/waypointeditor.html" logging.debug("HTML file: "+str(htmlfile)) - self.moz.load_url("file://"+htmlfile) + self.wkview.load_uri("file://"+htmlfile) logging.debug("<<") def createHtml(self,default_waypoint=None): Modified: pytrainer/trunk/pytrainer/main.py =================================================================== --- pytrainer/trunk/pytrainer/main.py 2011-06-23 00:30:19 UTC (rev 808) +++ pytrainer/trunk/pytrainer/main.py 2011-06-29 11:57:25 UTC (rev 809) @@ -54,7 +54,7 @@ class pyTrainer: def __init__(self,filename = None, data_path = None): #Version constants - self.version ="1.8.0-svn#805" + self.version ="1.8.0-svn#809" self.DB_version = 9 #Process command line options self.startup_options = self.get_options() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |