Fix the xep_0009 import (no more relatives)
Also, remove trailing spaces in all files of this plugin
This commit is contained in:
parent
1ed06bebcd
commit
4b71fba64c
@ -11,8 +11,6 @@ import base64
|
|||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
_namespace = 'jabber:iq:rpc'
|
_namespace = 'jabber:iq:rpc'
|
||||||
|
@ -16,12 +16,8 @@ import sys
|
|||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def _intercept(method, name, public):
|
def _intercept(method, name, public):
|
||||||
def _resolver(instance, *args, **kwargs):
|
def _resolver(instance, *args, **kwargs):
|
||||||
log.debug("Locally calling %s.%s with arguments %s." % (instance.FQN(), method.__name__, args))
|
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
|
return _wrap_remapped
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ACL:
|
class ACL:
|
||||||
'''
|
'''
|
||||||
An Access Control List (ACL) is a list of rules, which are evaluated
|
An Access Control List (ACL) is a list of rules, which are evaluated
|
||||||
@ -169,7 +164,6 @@ class ACL:
|
|||||||
ANY_ALL = [ (ACL.ALLOW, '*', '*') ]
|
ANY_ALL = [ (ACL.ALLOW, '*', '*') ]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RemoteException(Exception):
|
class RemoteException(Exception):
|
||||||
'''
|
'''
|
||||||
Base exception for RPC. This exception is raised when a problem
|
Base exception for RPC. This exception is raised when a problem
|
||||||
@ -216,7 +210,6 @@ class AuthorizationException(RemoteException):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TimeoutException(Exception):
|
class TimeoutException(Exception):
|
||||||
'''
|
'''
|
||||||
Exception raised when the synchronous execution of a method takes
|
Exception raised when the synchronous execution of a method takes
|
||||||
@ -226,7 +219,6 @@ class TimeoutException(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Callback(object):
|
class Callback(object):
|
||||||
'''
|
'''
|
||||||
A base class for callback handlers.
|
A base class for callback handlers.
|
||||||
@ -243,7 +235,6 @@ class Callback(object):
|
|||||||
return NotImplemented
|
return NotImplemented
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Future(Callback):
|
class Future(Callback):
|
||||||
'''
|
'''
|
||||||
Represents the result of an asynchronous computation.
|
Represents the result of an asynchronous computation.
|
||||||
@ -410,7 +401,6 @@ class Proxy(Endpoint):
|
|||||||
return self._endpoint.FQN()
|
return self._endpoint.FQN()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class JabberRPCEntry(object):
|
class JabberRPCEntry(object):
|
||||||
|
|
||||||
|
|
||||||
@ -432,7 +422,6 @@ class JabberRPCEntry(object):
|
|||||||
return args
|
return args
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class RemoteSession(object):
|
class RemoteSession(object):
|
||||||
'''
|
'''
|
||||||
A context object for a Jabber-RPC session.
|
A context object for a Jabber-RPC session.
|
||||||
@ -682,7 +671,6 @@ class RemoteSession(object):
|
|||||||
callback.cancel_with_error(e)
|
callback.cancel_with_error(e)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Remote(object):
|
class Remote(object):
|
||||||
'''
|
'''
|
||||||
Bootstrap class for Jabber-RPC sessions. New sessions are openend
|
Bootstrap class for Jabber-RPC sessions. New sessions are openend
|
||||||
@ -749,4 +737,3 @@ class Remote(object):
|
|||||||
client.registerPlugin('xep_0199') # XMPP Ping
|
client.registerPlugin('xep_0199') # XMPP Ping
|
||||||
return cls.new_session_with_client(client, callback)
|
return cls.new_session_with_client(client, callback)
|
||||||
|
|
||||||
|
|
@ -6,8 +6,8 @@
|
|||||||
See the file LICENSE for copying permission.
|
See the file LICENSE for copying permission.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .. import base
|
from sleekxmpp.plugins import base
|
||||||
from stanza.RPC import RPCQuery, MethodCall, MethodResponse
|
from sleekxmpp.plugins.xep_0009.stanza.RPC import RPCQuery, MethodCall, MethodResponse
|
||||||
from sleekxmpp.stanza.iq import Iq
|
from sleekxmpp.stanza.iq import Iq
|
||||||
from sleekxmpp.xmlstream.handler.callback import Callback
|
from sleekxmpp.xmlstream.handler.callback import Callback
|
||||||
from sleekxmpp.xmlstream.matcher.xpath import MatchXPath
|
from sleekxmpp.xmlstream.matcher.xpath import MatchXPath
|
||||||
|
@ -20,7 +20,6 @@ class RPCQuery(ElementBase):
|
|||||||
plugin_tag_map = {}
|
plugin_tag_map = {}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MethodCall(ElementBase):
|
class MethodCall(ElementBase):
|
||||||
name = 'methodCall'
|
name = 'methodCall'
|
||||||
namespace = 'jabber:iq:rpc'
|
namespace = 'jabber:iq:rpc'
|
||||||
@ -30,7 +29,6 @@ class MethodCall(ElementBase):
|
|||||||
plugin_attrib_map = {}
|
plugin_attrib_map = {}
|
||||||
plugin_tag_map = {}
|
plugin_tag_map = {}
|
||||||
|
|
||||||
|
|
||||||
def get_method_name(self):
|
def get_method_name(self):
|
||||||
return self._get_sub_text('methodName')
|
return self._get_sub_text('methodName')
|
||||||
|
|
||||||
@ -44,7 +42,6 @@ class MethodCall(ElementBase):
|
|||||||
self.append(params)
|
self.append(params)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class MethodResponse(ElementBase):
|
class MethodResponse(ElementBase):
|
||||||
name = 'methodResponse'
|
name = 'methodResponse'
|
||||||
namespace = 'jabber:iq:rpc'
|
namespace = 'jabber:iq:rpc'
|
||||||
@ -54,7 +51,6 @@ class MethodResponse(ElementBase):
|
|||||||
plugin_attrib_map = {}
|
plugin_attrib_map = {}
|
||||||
plugin_tag_map = {}
|
plugin_tag_map = {}
|
||||||
|
|
||||||
|
|
||||||
def get_params(self):
|
def get_params(self):
|
||||||
return self.xml.find('{%s}params' % self.namespace)
|
return self.xml.find('{%s}params' % self.namespace)
|
||||||
|
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
See the file LICENSE for copying permission.
|
See the file LICENSE for copying permission.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from RPC import RPCQuery, MethodCall, MethodResponse
|
from sleekxmpp.plugins.xep_0009.stanza.RPC import RPCQuery, MethodCall, MethodResponse
|
||||||
|
Loading…
Reference in New Issue
Block a user