[tryton-debian-vcs] tryton-modules-google-maps branch debian updated. debian/4.0.1-1-3-g03843ba

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


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

commit 03843ba2c7437823b3b664e68ce0b1651147cd48
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Sep 3 21:12:11 2016 +0200

    Releasing debian version 4.0.2-1.
    
    Signed-off-by: Mathias Behrle <mathiasb at m9s.biz>

diff --git a/debian/changelog b/debian/changelog
index 01e89ce..820d930 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+tryton-modules-google-maps (4.0.2-1) unstable; urgency=medium
+
+  * Updating to Standards-Version: 3.9.8, no changes needed.
+  * Merging upstream version 4.0.2.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Sat, 03 Sep 2016 21:12:11 +0200
+
 tryton-modules-google-maps (4.0.1-1) unstable; urgency=medium
 
   * Updating signing-key.asc with the actual upstream maintainer keys.
commit 4f2378af2eb6b76ad135e09f21e8fbd6be291b9e
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sat Sep 3 21:12:10 2016 +0200

    Merging upstream version 4.0.2.

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