[tryton-debian-vcs] tryton-modules-google-maps branch upstream updated. upstream/4.0.1-1-g6bb7c3c

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Sun Sep 4 16:57:30 UTC 2016


The following commit has been merged in the upstream branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-modules-google-maps.git;a=commitdiff;h=upstream/4.0.1-1-g6bb7c3c

commit 6bb7c3cd1c163f3f79c13e3da81206d0d9a4f1fb
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Sep 3 21:12:10 2016 +0200

    Adding upstream version 4.0.2.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/CHANGELOG b/CHANGELOG
index 80bc1e3..b1b7f07 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 4.0.2 - 2016-09-03
+* Bug fixes (see mercurial logs for details)
+
 Version 4.0.1 - 2016-05-11
 * Bug fixes (see mercurial logs for details)
 
diff --git a/PKG-INFO b/PKG-INFO
index b8e8f93..0f626ba 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond_google_maps
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module to link addresses to Google Maps
 Home-page: http://www.tryton.org/
 Author: Tryton
diff --git a/address.py b/address.py
index 6bc5b86..a571782 100644
--- a/address.py
+++ b/address.py
@@ -1,6 +1,8 @@
 # This file is part of Tryton.  The COPYRIGHT file at the top level of
 # this repository contains the full copyright notices and license terms.
 import urllib
+import sys
+
 from trytond.model import fields
 from trytond.transaction import Transaction
 from trytond.pool import PoolMeta
@@ -29,11 +31,14 @@ class Address:
                 self.subdivision.name if self.subdivision else None,
                 ):
             if value:
-                if isinstance(value, str):
+                if isinstance(value, str) and sys.version_info < (3,):
                     url += ' ' + value.decode('utf-8')
                 else:
                     url += ' ' + value
-        if url.strip():
+        url = url.strip()
+        if url:
+            if sys.version_info < (3,):
+                url = url.encode('utf-8')
             return 'http://maps.google.com/maps?hl=%s&q=%s' % \
-                (lang, urllib.quote(url.strip().encode('utf-8')))
+                (lang, urllib.quote(url))
         return ''
diff --git a/tests/test_google_maps.py b/tests/test_google_maps.py
index 304b192..dba7b81 100644
--- a/tests/test_google_maps.py
+++ b/tests/test_google_maps.py
@@ -2,13 +2,29 @@
 # this repository contains the full copyright notices and license terms.
 import unittest
 import trytond.tests.test_tryton
-from trytond.tests.test_tryton import ModuleTestCase
+from trytond.tests.test_tryton import ModuleTestCase, with_transaction
+from trytond.pool import Pool
 
 
 class GoogleMapsTestCase(ModuleTestCase):
     'Test GoogleMaps module'
     module = 'google_maps'
 
+    @with_transaction()
+    def test_google_maps_url(self):
+        "Test Google Maps URL"
+        pool = Pool()
+        Address = pool.get('party.address')
+        address = Address()
+        address.street = "300 Cliff Street"
+        address.zip = "18503"
+        address.city = "Scranton"
+
+        self.assertEqual(
+            address.on_change_with_google_maps_url(),
+            'http://maps.google.com/maps?hl=en&'
+            'q=300%20Cliff%20Street%2018503%20Scranton')
+
 
 def suite():
     suite = trytond.tests.test_tryton.suite()
diff --git a/tryton.cfg b/tryton.cfg
index a10fdca..9d517e8 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=4.0.1
+version=4.0.2
 depends:
     ir
     party
diff --git a/trytond_google_maps.egg-info/PKG-INFO b/trytond_google_maps.egg-info/PKG-INFO
index da1e81d..255394e 100644
--- a/trytond_google_maps.egg-info/PKG-INFO
+++ b/trytond_google_maps.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: trytond-google-maps
-Version: 4.0.1
+Version: 4.0.2
 Summary: Tryton module to link addresses to Google Maps
 Home-page: http://www.tryton.org/
 Author: Tryton
-- 
tryton-modules-google-maps



More information about the tryton-debian-vcs mailing list