From 84c967de98d8d360a6ea26a2b8cffc36af5664c5 Mon Sep 17 00:00:00 2001 From: kirsn Date: Wed, 21 Jan 2015 23:35:56 +0530 Subject: [PATCH 1/4] Issue 2035: Fix the caching on Windows - issue with filenames greater than 256 chars --- gluon/cache.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gluon/cache.py b/gluon/cache.py index 671abe7e..60b31351 100644 --- a/gluon/cache.py +++ b/gluon/cache.py @@ -282,6 +282,17 @@ class CacheOnDisk(CacheAbstract): ] def replace_windows(src, dst): + """ + The Windows filesystem has a 256 character limit for the filename. + To use filenames longer than that, the '\\?\' prefix needs to be used. + By default, this prefix is added to all windows filenames, + when accessing it. + View this for details: http://stackoverflow.com/a/23230380/348142 + """ + windows_prefix = "\\\\?\\" + dst = windows_prefix + dst + src = windows_prefix + src + if not ReplaceFile(dst, src, None, 0, 0, 0): os.rename(src, dst) From d2c25a0021992d8eb90df55d498e6bd628b0b449 Mon Sep 17 00:00:00 2001 From: Fran Boon Date: Thu, 22 Jan 2015 11:45:46 +0000 Subject: [PATCH 2/4] Add support for ST_SimplifyPreserveTopology --- gluon/dal/adapters/postgres.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gluon/dal/adapters/postgres.py b/gluon/dal/adapters/postgres.py index 7e8c32fd..6694ae0b 100644 --- a/gluon/dal/adapters/postgres.py +++ b/gluon/dal/adapters/postgres.py @@ -278,6 +278,12 @@ class PostgreSQLAdapter(BaseAdapter): """ return 'ST_Simplify(%s,%s)' %(self.expand(first), self.expand(second, 'double')) + def ST_SIMPLIFYPRESERVETOPOLOGY(self, first, second): + """ + http://postgis.org/docs/ST_SimplifyPreserveTopology.html + """ + return 'ST_SimplifyPreserveTopology(%s,%s)' %(self.expand(first), self.expand(second, 'double')) + def ST_TOUCHES(self, first, second): """ http://postgis.org/docs/ST_Touches.html From 739b2e8a7b21e5ffeb8a10102642e5539a2a8b5a Mon Sep 17 00:00:00 2001 From: Fran Boon Date: Thu, 22 Jan 2015 11:52:42 +0000 Subject: [PATCH 3/4] Update objects.py --- gluon/dal/objects.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gluon/dal/objects.py b/gluon/dal/objects.py index 9c22449a..7c4cb03f 100644 --- a/gluon/dal/objects.py +++ b/gluon/dal/objects.py @@ -1304,6 +1304,10 @@ class Expression(object): db = self.db return Expression(db, db._adapter.ST_SIMPLIFY, self, value, self.type) + def st_simplifypreservetopology(self, value): + db = self.db + return Expression(db, db._adapter.ST_SIMPLIFYPRESERVETOPOLOGY, self, value, self.type) + # GIS queries def st_contains(self, value): From a90a701c0d437774a52fec2a9f687972caf6b718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dragan=20Mati=C4=87?= Date: Fri, 23 Jan 2015 11:26:18 +0100 Subject: [PATCH 4/4] Script for centos7 now also installs 'unzip' package Some virtual server providers (like DigitalOcean) do not have unzip installed in their centos7 image so we need to install it in our script. --- scripts/setup-web2py-centos7.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/setup-web2py-centos7.sh b/scripts/setup-web2py-centos7.sh index 340ac05d..4d28ac06 100644 --- a/scripts/setup-web2py-centos7.sh +++ b/scripts/setup-web2py-centos7.sh @@ -56,7 +56,7 @@ echo yum update # Install required packages -yum install httpd mod_ssl mod_wsgi wget python +yum install httpd mod_ssl mod_wsgi wget python unzip ### ### Phase 2 - Install web2py