From 6bd115f09b5f494026476b4584c9a08981619b55 Mon Sep 17 00:00:00 2001 From: matthew-b-payne Date: Wed, 19 Oct 2011 23:23:09 -0300 Subject: [PATCH 1/2] Enabling the GuessContentType plugin is essential for webdav clients being about to present image previews. mime type will now be sent back in the response. http://code.google.com/p/sabredav/wiki/GuessContentType --- 3.0/modules/webdav/controllers/webdav.php | 1 + 1 file changed, 1 insertion(+) diff --git a/3.0/modules/webdav/controllers/webdav.php b/3.0/modules/webdav/controllers/webdav.php index da389d25..829de6ec 100644 --- a/3.0/modules/webdav/controllers/webdav.php +++ b/3.0/modules/webdav/controllers/webdav.php @@ -34,6 +34,7 @@ class WebDAV_Controller extends Controller { $server->setBaseUri(url::site("webdav/gallery")); // $server->addPlugin($lock); $server->addPlugin($filter); + $server->addPlugin(new Sabre_DAV_Browser_GuessContentType()); if ($this->_authenticate()) { $server->exec(); From e0ccd97af6088470f5b3a2131a069b61af978bcb Mon Sep 17 00:00:00 2001 From: Jay Deiman Date: Wed, 2 Nov 2011 11:52:46 -0500 Subject: [PATCH 2/2] Added import fallback of simplejson and removed a debug statement --- 3.0/client/Python/pylibgal3/libg3/G3Items.py | 11 ++++++++++- 3.0/client/Python/pylibgal3/libg3/Gallery3.py | 11 +++++++++-- 3.0/client/Python/pylibgal3/libg3/__init__.py | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/3.0/client/Python/pylibgal3/libg3/G3Items.py b/3.0/client/Python/pylibgal3/libg3/G3Items.py index 0fdae593..ce812551 100644 --- a/3.0/client/Python/pylibgal3/libg3/G3Items.py +++ b/3.0/client/Python/pylibgal3/libg3/G3Items.py @@ -22,7 +22,16 @@ __all__ = ['Album' , 'Image' , 'LocalImage' , 'RemoteImage' , 'LocalMovie' , 'RemoteMovie' , 'getItemFromResp' , 'getItemsFromResp'] from datetime import datetime -import json , weakref , types , os , mimetypes , re +import weakref , types , os , mimetypes , re +try: + import json +except: + try: + import simplejson + except ImportError , e: + raise ImportError('You must have either the "json" or "simplejson"' + 'library installed!') + class BaseRemote(object): def __init__(self , respObj , weakGalObj , weakParent=None): diff --git a/3.0/client/Python/pylibgal3/libg3/Gallery3.py b/3.0/client/Python/pylibgal3/libg3/Gallery3.py index 6345c1a8..13409c8a 100644 --- a/3.0/client/Python/pylibgal3/libg3/Gallery3.py +++ b/3.0/client/Python/pylibgal3/libg3/Gallery3.py @@ -26,7 +26,15 @@ from G3Items import getItemFromResp , getItemsFromResp , BaseRemote , Album , \ RemoteImage , Tag from urllib import quote , urlencode from uuid import uuid4 -import urllib2 , os , json +import urllib2 , os +try: + import json +except: + try: + import simplejson + except ImportError , e: + raise ImportError('You must have either the "json" or "simplejson"' + 'library installed!') class Gallery3(object): """ @@ -129,7 +137,6 @@ class Gallery3(object): uri(str) : The uri string defining the resource on the defined host """ url = self._buildUrl(uri , kwargs) - print url return self.getRespFromUrl(url) def addAlbum(self , parent , albumName , title , description=''): diff --git a/3.0/client/Python/pylibgal3/libg3/__init__.py b/3.0/client/Python/pylibgal3/libg3/__init__.py index eec91668..3805ff18 100644 --- a/3.0/client/Python/pylibgal3/libg3/__init__.py +++ b/3.0/client/Python/pylibgal3/libg3/__init__.py @@ -21,4 +21,4 @@ from G3Items import * from Gallery3 import * -__version__ = '0.1.4' +__version__ = '0.1.5'