Fix the xep_0009 import (no more relatives)

Also, remove trailing spaces in all files
of this plugin
This commit is contained in:
Florent Le Coz 2011-02-09 09:45:45 +08:00 committed by Lance Stout
parent 1ed06bebcd
commit 4b71fba64c
5 changed files with 180 additions and 199 deletions

View file

@ -11,8 +11,6 @@ import base64
import logging
import time
log = logging.getLogger(__name__)
_namespace = 'jabber:iq:rpc'

View file

@ -16,12 +16,8 @@ import sys
import threading
import traceback
log = logging.getLogger(__name__)
def _intercept(method, name, public):
def _resolver(instance, *args, **kwargs):
log.debug("Locally calling %s.%s with arguments %s." % (instance.FQN(), method.__name__, args))
@ -86,7 +82,6 @@ def remote(function_argument, public = True):
return _wrap_remapped
class ACL:
'''
An Access Control List (ACL) is a list of rules, which are evaluated
@ -169,7 +164,6 @@ class ACL:
ANY_ALL = [ (ACL.ALLOW, '*', '*') ]
class RemoteException(Exception):
'''
Base exception for RPC. This exception is raised when a problem
@ -216,7 +210,6 @@ class AuthorizationException(RemoteException):
pass
class TimeoutException(Exception):
'''
Exception raised when the synchronous execution of a method takes
@ -226,7 +219,6 @@ class TimeoutException(Exception):
pass
class Callback(object):
'''
A base class for callback handlers.
@ -243,7 +235,6 @@ class Callback(object):
return NotImplemented
class Future(Callback):
'''
Represents the result of an asynchronous computation.
@ -410,7 +401,6 @@ class Proxy(Endpoint):
return self._endpoint.FQN()
class JabberRPCEntry(object):
@ -432,7 +422,6 @@ class JabberRPCEntry(object):
return args
class RemoteSession(object):
'''
A context object for a Jabber-RPC session.
@ -682,7 +671,6 @@ class RemoteSession(object):
callback.cancel_with_error(e)
class Remote(object):
'''
Bootstrap class for Jabber-RPC sessions. New sessions are openend
@ -749,4 +737,3 @@ class Remote(object):
client.registerPlugin('xep_0199') # XMPP Ping
return cls.new_session_with_client(client, callback)

View file

@ -6,8 +6,8 @@
See the file LICENSE for copying permission.
"""
from .. import base
from stanza.RPC import RPCQuery, MethodCall, MethodResponse
from sleekxmpp.plugins import base
from sleekxmpp.plugins.xep_0009.stanza.RPC import RPCQuery, MethodCall, MethodResponse
from sleekxmpp.stanza.iq import Iq
from sleekxmpp.xmlstream.handler.callback import Callback
from sleekxmpp.xmlstream.matcher.xpath import MatchXPath

View file

@ -20,7 +20,6 @@ class RPCQuery(ElementBase):
plugin_tag_map = {}
class MethodCall(ElementBase):
name = 'methodCall'
namespace = 'jabber:iq:rpc'
@ -30,7 +29,6 @@ class MethodCall(ElementBase):
plugin_attrib_map = {}
plugin_tag_map = {}
def get_method_name(self):
return self._get_sub_text('methodName')
@ -44,7 +42,6 @@ class MethodCall(ElementBase):
self.append(params)
class MethodResponse(ElementBase):
name = 'methodResponse'
namespace = 'jabber:iq:rpc'
@ -54,7 +51,6 @@ class MethodResponse(ElementBase):
plugin_attrib_map = {}
plugin_tag_map = {}
def get_params(self):
return self.xml.find('{%s}params' % self.namespace)

View file

@ -6,4 +6,4 @@
See the file LICENSE for copying permission.
"""
from RPC import RPCQuery, MethodCall, MethodResponse
from sleekxmpp.plugins.xep_0009.stanza.RPC import RPCQuery, MethodCall, MethodResponse