[tryton-debian-vcs] tryton-modules-party-vcarddav branch debian updated. debian/2.8.0-3-5-g7bd5ef1

git repository hosting tryton-debian-vcs at m9s.biz
Mon Nov 25 19:35:35 UTC 2013


The following commit has been merged in the debian branch:
http://debian.tryton.org/gitweb/?p=packages/tryton-modules-party-vcarddav.git;a=commitdiff;h=debian/2.8.0-3-5-g7bd5ef1

commit 7bd5ef1fd496881ceebb8c85617698d45cb37140
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Nov 25 20:30:17 2013 +0100

    Releasing debian version 3.0.0-1.

diff --git a/debian/changelog b/debian/changelog
index 69eff4d..d1c7990 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,12 @@
+tryton-modules-party-vcarddav (3.0.0-1) unstable; urgency=low
+
+  * Merging upstream version 3.0.0.
+  * Updating to standards version 3.9.5, no changes needed.
+  * Changing to buildsystem pybuild.
+  * Adding python-sql to Depends.
+
+ -- Mathias Behrle <mathiasb at m9s.biz>  Mon, 25 Nov 2013 17:54:23 +0100
+
 tryton-modules-party-vcarddav (2.8.0-3) unstable; urgency=low
 
   * Removing pydist-overrides, it is no more needed.
commit 8ae5300ef82e07c2514cc4d07c708ee237cd7500
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Mon Nov 25 17:43:05 2013 +0100

    Adding python-sql to Depends.

diff --git a/debian/control b/debian/control
index dd488cf..65a59eb 100644
--- a/debian/control
+++ b/debian/control
@@ -16,7 +16,7 @@ Architecture: all
 Depends:
  ${misc:Depends}, ${python:Depends}, tryton-server (>= ${version:major}),
  tryton-modules-party (>= ${version:major}), python-vobject, python-webdav,
- python-pkg-resources
+ python-sql, python-pkg-resources
 Description: Tryton Application Platform (Party CardDAV Module)
  Tryton is a high-level general purpose application platform written in Python
  and using PostgreSQL as database engine. It is the core base of a complete
commit 7e97dc6b2d1de29efbbbda1032d1b94a6415aeae
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 19:51:51 2013 +0100

    Changing to buildsystem pybuild.

diff --git a/debian/control b/debian/control
index a94cd3c..dd488cf 100644
--- a/debian/control
+++ b/debian/control
@@ -3,7 +3,8 @@ Section: python
 Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Mathias Behrle <mathiasb at m9s.biz>
-Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
+Build-Depends:
+ debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools, dh-python
 Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-party-vcarddav.git
diff --git a/debian/rules b/debian/rules
index 30074ad..5b8c326 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,24 +1,17 @@
 #!/usr/bin/make -f
 
-MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
-PACKAGE_NAME := $(shell python setup.py --name)
-
-%:
-	dh ${@} --with python2
+# needed for pbuilder
+export LC_ALL=C.UTF-8
 
-override_dh_auto_clean:
-	dh_auto_clean
+MAJOR := $(shell python setup.py --version | awk -F "." '{print $$1 "." $$2}')
+PACKAGE_NAME := tryton-modules-$(shell python setup.py --name | sed s/^trytond_// | sed s/_/-/g)
+export PYBUILD_DESTDIR_python2=debian/${PACKAGE_NAME}
 
-override_dh_auto_build:
-	mv $(PACKAGE_NAME).egg-info $(PACKAGE_NAME).hen-info
-	mv PKG-INFO PKG-INFO.hen
-	dh_auto_build
+# Don't run tests for Tryton modules, they try to download dependencies from pypi
+export PYBUILD_DISABLE_python2.7=test
 
-override_dh_auto_install:
-	dh_auto_install
-	rm -rf *.egg-info
-	mv $(PACKAGE_NAME).hen-info $(PACKAGE_NAME).egg-info
-	mv PKG-INFO.hen PKG-INFO
+%:
+	dh ${@} --with python2 --buildsystem=pybuild
 
 override_dh_gencontrol:
 	dh_gencontrol -- -Vversion:major="$(MAJOR)"
commit 409e54845466d3a021d48982d53565667035088a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 19:14:21 2013 +0100

    Updating to standards version 3.9.5, no changes needed.

diff --git a/debian/control b/debian/control
index 1b3e84a..a94cd3c 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: optional
 Maintainer: Debian Tryton Maintainers <maintainers at debian.tryton.org>
 Uploaders: Mathias Behrle <mathiasb at m9s.biz>
 Build-Depends: debhelper (>= 9), python (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.4
+Standards-Version: 3.9.5
 Homepage: http://www.tryton.org/
 Vcs-Browser: http://debian.tryton.org/gitweb/?p=packages/tryton-modules-party-vcarddav.git
 Vcs-Git: git://debian.tryton.org/packages/tryton-modules-party-vcarddav.git
commit cb75fcc4b21f80262a55b63fdc6c379814e929b7
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Sun Nov 24 17:27:25 2013 +0100

    Merging upstream version 3.0.0.

diff --git a/CHANGELOG b/CHANGELOG
index 7f34659..7d5a2bd 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 3.0.0 - 2013-10-21
+* Bug fixes (see mercurial logs for details)
+
 Version 2.8.0 - 2013-04-22
 * Bug fixes (see mercurial logs for details)
 
diff --git a/INSTALL b/INSTALL
index 1a36e89..4ece669 100644
--- a/INSTALL
+++ b/INSTALL
@@ -9,6 +9,7 @@ Prerequisites
  * trytond_party (http://www.tryton.org/)
  * vobject 0.8.0 or later (http://vobject.skyhouseconsulting.com/)
  * pywebdav 0.9.8 or later (http://sourceforge.net/projects/pywebdav/)
+ * python-sql (http://code.google.com/p/python-sql/)
 
 Installation
 ------------
diff --git a/PKG-INFO b/PKG-INFO
index 0fc8a56..e02ee4f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond_party_vcarddav
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module for CardDAV
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_party_vcarddav
         ======================
         
@@ -61,6 +61,7 @@ Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/locale/es_ES.po b/locale/es_ES.po
index e1adc11..1ada398 100644
--- a/locale/es_ES.po
+++ b/locale/es_ES.po
@@ -5,7 +5,7 @@ msgstr "Content-Type: text/plain; charset=utf-8\n"
 msgctxt "error:ir.action.report:"
 msgid "Invalid email definition on report \"%s\"."
 msgstr ""
-"La definición de correo electrónico sobre el informe \"%s\", no es correcta."
+"La definición de correo electrónico sobre el informe \"%s\" no es correcta."
 
 msgctxt "error:party.party:"
 msgid "The UUID of the party must be unique."
diff --git a/locale/sl_SI.po b/locale/sl_SI.po
new file mode 100644
index 0000000..cb74981
--- /dev/null
+++ b/locale/sl_SI.po
@@ -0,0 +1,23 @@
+# 
+msgid ""
+msgstr "Content-Type: text/plain; charset=utf-8\n"
+
+msgctxt "error:party.party:"
+msgid "The UUID of the party must be unique."
+msgstr "UUID stranke mora biti edinstven."
+
+msgctxt "field:party.party,uuid:"
+msgid "UUID"
+msgstr "UUID"
+
+msgctxt "field:party.party,vcard:"
+msgid "VCard"
+msgstr "VCard"
+
+msgctxt "help:party.party,uuid:"
+msgid "Universally Unique Identifier"
+msgstr "Vsesplošno edinstven identifikator"
+
+msgctxt "model:ir.action,name:report_party_vcard"
+msgid "VCard"
+msgstr "VCard"
diff --git a/party.py b/party.py
index 63712b7..2a9e860 100644
--- a/party.py
+++ b/party.py
@@ -5,7 +5,7 @@ import vobject
 
 from trytond.model import fields
 from trytond.report import Report
-from trytond.backend import TableHandler, FIELDS
+from trytond import backend
 from trytond.transaction import Transaction
 from trytond.pool import Pool, PoolMeta
 
@@ -29,18 +29,21 @@ class Party:
 
     @classmethod
     def __register__(cls, module_name):
+        TableHandler = backend.get('TableHandler')
         cursor = Transaction().cursor
         table = TableHandler(cursor, cls, module_name)
+        sql_table = cls.__table__()
 
         if not table.column_exist('uuid'):
             table.add_raw_column('uuid',
-                FIELDS[cls.uuid._type].sql_type(cls.uuid),
-                FIELDS[cls.uuid._type].sql_format, None, None)
-            cursor.execute('SELECT id FROM "' + cls._table + '"')
+                cls.uuid.sql_type(),
+                cls.uuid.sql_format, None, None)
+            cursor.execute(*sql_table.select(sql_table.id))
             for id, in cursor.fetchall():
-                cursor.execute('UPDATE "' + cls._table + '" '
-                    'SET "uuid" = %s WHERE id = %s',
-                    (cls.default_uuid(), id))
+                cursor.execute(*sql_table.update(
+                        columns=[sql_table.uuid],
+                        values=[cls.default_uuid()],
+                        where=sql_table.id == id))
         super(Party, cls).__register__(module_name)
 
     @staticmethod
diff --git a/setup.py b/setup.py
index b853d85..f188b3b 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ major_version, minor_version, _ = info.get('version', '0.0.1').split('.', 2)
 major_version = int(major_version)
 minor_version = int(minor_version)
 
-requires = ['vobject >= 0.8.0', 'PyWebDAV >= 0.9.8']
+requires = ['vobject >= 0.8.0', 'PyWebDAV >= 0.9.8', 'python-sql']
 for dep in info.get('depends', []):
     if not re.match(r'(ir|res|webdav)(\W|$)', dep):
         requires.append('trytond_%s >= %s.%s, < %s.%s' %
@@ -63,6 +63,7 @@ setup(name='trytond_party_vcarddav',
         'Natural Language :: French',
         'Natural Language :: German',
         'Natural Language :: Russian',
+        'Natural Language :: Slovenian',
         'Natural Language :: Spanish',
         'Operating System :: OS Independent',
         'Programming Language :: Python :: 2.6',
diff --git a/tryton.cfg b/tryton.cfg
index 273c8c4..802b318 100644
--- a/tryton.cfg
+++ b/tryton.cfg
@@ -1,5 +1,5 @@
 [tryton]
-version=2.8.0
+version=3.0.0
 depends:
     ir
     party
diff --git a/trytond_party_vcarddav.egg-info/PKG-INFO b/trytond_party_vcarddav.egg-info/PKG-INFO
index 7789dea..b08822f 100644
--- a/trytond_party_vcarddav.egg-info/PKG-INFO
+++ b/trytond_party_vcarddav.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
 Metadata-Version: 1.1
 Name: trytond-party-vcarddav
-Version: 2.8.0
+Version: 3.0.0
 Summary: Tryton module for CardDAV
 Home-page: http://www.tryton.org/
 Author: Tryton
 Author-email: UNKNOWN
 License: GPL-3
-Download-URL: http://downloads.tryton.org/2.8/
+Download-URL: http://downloads.tryton.org/3.0/
 Description: trytond_party_vcarddav
         ======================
         
@@ -61,6 +61,7 @@ Classifier: Natural Language :: English
 Classifier: Natural Language :: French
 Classifier: Natural Language :: German
 Classifier: Natural Language :: Russian
+Classifier: Natural Language :: Slovenian
 Classifier: Natural Language :: Spanish
 Classifier: Operating System :: OS Independent
 Classifier: Programming Language :: Python :: 2.6
diff --git a/trytond_party_vcarddav.egg-info/SOURCES.txt b/trytond_party_vcarddav.egg-info/SOURCES.txt
index 6f88556..61ff6d3 100644
--- a/trytond_party_vcarddav.egg-info/SOURCES.txt
+++ b/trytond_party_vcarddav.egg-info/SOURCES.txt
@@ -22,6 +22,7 @@ locale/es_ES.po
 locale/fr_FR.po
 locale/nl_NL.po
 locale/ru_RU.po
+locale/sl_SI.po
 trytond_party_vcarddav.egg-info/PKG-INFO
 trytond_party_vcarddav.egg-info/SOURCES.txt
 trytond_party_vcarddav.egg-info/dependency_links.txt
diff --git a/trytond_party_vcarddav.egg-info/requires.txt b/trytond_party_vcarddav.egg-info/requires.txt
index 583404b..085c9e7 100644
--- a/trytond_party_vcarddav.egg-info/requires.txt
+++ b/trytond_party_vcarddav.egg-info/requires.txt
@@ -1,4 +1,5 @@
 vobject >= 0.8.0
 PyWebDAV >= 0.9.8
-trytond_party >= 2.8, < 2.9
-trytond >= 2.8, < 2.9
\ No newline at end of file
+python-sql
+trytond_party >= 3.0, < 3.1
+trytond >= 3.0, < 3.1
\ No newline at end of file
diff --git a/webdav.py b/webdav.py
index 9749c7a..fdab179 100644
--- a/webdav.py
+++ b/webdav.py
@@ -2,6 +2,10 @@
 #this repository contains the full copyright notices and license terms.
 from pywebdav.lib.errors import DAV_NotFound, DAV_Forbidden
 from pywebdav.lib.constants import COLLECTION, OBJECT
+from sql.functions import Extract
+from sql.aggregate import Max
+from sql.conditionals import Coalesce
+
 from trytond.tools import reduce_ids
 from trytond.transaction import Transaction
 from trytond.cache import Cache
@@ -170,6 +174,7 @@ class Collection:
     @classmethod
     def get_creationdate(cls, uri, cache=None):
         Party = Pool().get('party.party')
+        party = Party.__table__()
         party_id = cls.vcard(uri)
 
         cursor = Transaction().cursor
@@ -189,11 +194,10 @@ class Collection:
             res = None
             for i in range(0, len(ids), cursor.IN_MAX):
                 sub_ids = ids[i:i + cursor.IN_MAX]
-                red_sql, red_ids = reduce_ids('id', sub_ids)
-                cursor.execute('SELECT id, '
-                        'EXTRACT(epoch FROM create_date) '
-                    'FROM "' + Party._table + '" '
-                    'WHERE ' + red_sql, red_ids)
+                red_sql = reduce_ids(party.id, sub_ids)
+                cursor.execute(*party.select(party.id,
+                        Extract('EPOCH', party.create_date),
+                        where=red_sql))
                 for party_id2, date in cursor.fetchall():
                     if party_id2 == party_id:
                         res = date
@@ -210,6 +214,9 @@ class Collection:
         Party = pool.get('party.party')
         Address = pool.get('party.address')
         ContactMechanism = pool.get('party.contact_mechanism')
+        party = Party.__table__()
+        address = Address.__table__()
+        contact_mechanism = ContactMechanism.__table__()
 
         cursor = Transaction().cursor
 
@@ -227,21 +234,21 @@ class Collection:
             res = None
             for i in range(0, len(ids), cursor.IN_MAX):
                 sub_ids = ids[i:i + cursor.IN_MAX]
-                red_sql, red_ids = reduce_ids('p.id', sub_ids)
-                cursor.execute('SELECT p.id, '
-                        'MAX(EXTRACT(epoch FROM '
-                            'COALESCE(p.write_date, p.create_date))), '
-                        'MAX(EXTRACT(epoch FROM '
-                            'COALESCE(a.write_date, a.create_date))), '
-                        'MAX(EXTRACT(epoch FROM '
-                            'COALESCE(c.write_date, c.create_date))) '
-                    'FROM "' + Party._table + '" p '
-                    'LEFT JOIN "' + Address._table + '" a '
-                        'ON p.id = a.party '
-                    'LEFT JOIN "' + ContactMechanism._table + '" c '
-                        'ON p.id = c.party '
-                    'WHERE ' + red_sql + ' '
-                    'GROUP BY p.id', red_ids)
+                red_sql = reduce_ids(party.id, sub_ids)
+                cursor.execute(*party.join(address, 'LEFT',
+                        condition=party.id == address.party
+                        ).join(contact_mechanism, 'LEFT',
+                        condition=party.id == contact_mechanism.party
+                        ).select(party.id,
+                        Max(Extract('EPOCH', Coalesce(party.write_date,
+                                    party.create_date))),
+                        Max(Extract('EPOCH', Coalesce(address.write_date,
+                                    address.create_date))),
+                        Max(Extract('EPOCH', Coalesce(
+                                    contact_mechanism.write_date,
+                                    contact_mechanism.create_date))),
+                        where=red_sql,
+                        group_by=party.id))
                 for party_id2, date_p, date_a, date_c in cursor.fetchall():
                     date = max(date_p, date_a, date_c)
                     if party_id2 == party_id:
-- 
tryton-modules-party-vcarddav



More information about the tryton-debian-vcs mailing list