From b376fa58b0b19d760aa0cfcaab6171b0a698c3d3 Mon Sep 17 00:00:00 2001 From: Neha shah Date: Fri, 1 Jun 2012 18:39:21 +0530 Subject: Get and Set methods updated in XMLRPC --- gstudio/xmlrpc/__init__.py | 1 + gstudio/xmlrpc/decorators.py | 2 +- gstudio/xmlrpc/dispatcher.py | 2 ++ gstudio/xmlrpc/metaweblog.py | 6 +++--- gstudio/xmlrpc/views.py | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) (limited to 'gstudio/xmlrpc') diff --git a/gstudio/xmlrpc/__init__.py b/gstudio/xmlrpc/__init__.py index beb1e722..318e6d9f 100644 --- a/gstudio/xmlrpc/__init__.py +++ b/gstudio/xmlrpc/__init__.py @@ -54,6 +54,7 @@ GSTUDIO_XMLRPC_PINGBACK = [ ('gstudio.xmlrpc.pingback.pingback_extensions_get_pingbacks', 'pingback.extensions.getPingbacks')] +# The tuple has been modified to include entries for get and set functions GSTUDIO_XMLRPC_METAWEBLOG = [ ('gstudio.xmlrpc.metaweblog.get_users_blogs', 'blogger.getUsersBlogs'), diff --git a/gstudio/xmlrpc/decorators.py b/gstudio/xmlrpc/decorators.py index 4218a4fd..5d13feaa 100644 --- a/gstudio/xmlrpc/decorators.py +++ b/gstudio/xmlrpc/decorators.py @@ -42,7 +42,7 @@ from xmlrpclib import Fault from django.contrib.auth import authenticate from django.utils.translation import gettext as _ - +# This file is needed to run XMLRPC ! # Some constants for your pleasure #XXX: Any standardization? AUTHENTICATION_FAILED_CODE = 81 diff --git a/gstudio/xmlrpc/dispatcher.py b/gstudio/xmlrpc/dispatcher.py index f4014578..28291845 100644 --- a/gstudio/xmlrpc/dispatcher.py +++ b/gstudio/xmlrpc/dispatcher.py @@ -37,6 +37,8 @@ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ +# This file is needed to run XMLRPC + from inspect import getargspec from SimpleXMLRPCServer import SimpleXMLRPCDispatcher from django.conf import settings diff --git a/gstudio/xmlrpc/metaweblog.py b/gstudio/xmlrpc/metaweblog.py index 600e3dc4..4dd1fe1a 100644 --- a/gstudio/xmlrpc/metaweblog.py +++ b/gstudio/xmlrpc/metaweblog.py @@ -380,7 +380,7 @@ def new_media_object(blog_id, username, password, media): ContentFile(media['bits'].data)) return {'url': default_storage.url(path)} - +# Get functions start from here @xmlrpc_func(returns='string', args='int') def getNodetype(ssid): """Returns the nodetype of given nid """ @@ -478,7 +478,7 @@ def getAttributeType(subjecttypelist): d[str(s)] = "Node Does not Exist" return d - +# Get all function for getting all nodetypes @xmlrpc_func(returns='struct', args='string') def getAll(nodetype): @@ -658,7 +658,7 @@ def getAllSnapshots(nid) : return "Node Does Not Exist" return n - +# Set functions begin from here @xmlrpc_func(returns='string', args=['struct','string']) def setAttributetype(d,objid) : diff --git a/gstudio/xmlrpc/views.py b/gstudio/xmlrpc/views.py index 1edfa37e..0bcd4f09 100644 --- a/gstudio/xmlrpc/views.py +++ b/gstudio/xmlrpc/views.py @@ -157,6 +157,7 @@ if hasattr(settings, 'XMLRPC_METHODS'): + '"%s" is not callable in module %s' % (attr, module)) #xmlrpcdispatcher.register_function(func, name) +# Registration for Gnowsys-studio XMLRPC functions xmlrpcdispatcher.register_function(getNodetype,'getNodetype') xmlrpcdispatcher.register_function(nidExists,'nidExists') xmlrpcdispatcher.register_function(getinfoFromSSID,'getinfoFromSSID') -- cgit v1.2.3-70-g09d2