Example #1
0
def _handle_unavailable_rpc_method(method, rt_obj):
    msg = "Method isn't available."
    if rt_obj._get_client_version_tuple() < method.min_version:
        msg = "This method is only available in " \
            "RTorrent version v{0} or later".format(
            convert_version_tuple_to_str(method.min_version))

    raise MethodError(msg)
Example #2
0
 def __init__(self, min_version, cur_version):
     self.min_version = min_version
     self.cur_version = cur_version
     self.msg = "Minimum version required: {0}".format(
         convert_version_tuple_to_str(min_version))
Example #3
0
from rtorrentlib.common import is_valid_port, convert_version_tuple_to_str
from rtorrentlib.group import Group
from rtorrentlib.lib.torrentparser import TorrentParser
from rtorrentlib.lib.xmlrpc.http import HTTPServerProxy
from rtorrentlib.lib.xmlrpc.requests_transport import RequestsTransport
from rtorrentlib.lib.xmlrpc.scgi import SCGIServerProxy
from rtorrentlib.rpc import Method
from rtorrentlib.torrent import Torrent

__version__ = "0.2.9"
__author__ = "Chris Lucas"
__contact__ = "*****@*****.**"
__license__ = "MIT"

MIN_RTORRENT_VERSION = (0, 9, 0)
MIN_RTORRENT_VERSION_STR = convert_version_tuple_to_str(MIN_RTORRENT_VERSION)
MAX_RETRIES = 5


class RTorrent:
    """ Create a new rTorrent connection """
    rpc_prefix = None

    def __init__(self,
                 uri,
                 username=None,
                 password=None,
                 verify=False,
                 sp=None,
                 sp_kwargs=None,
                 tp_kwargs=None):
Example #4
0
    convert_version_tuple_to_str)  # @UnresolvedImport
from rtorrentlib.group import Group  # @UnresolvedImport
from rtorrentlib.lib.torrentparser import TorrentParser  # @UnresolvedImport
from rtorrentlib.lib.xmlrpc.http import HTTPServerProxy  # @UnresolvedImport
from rtorrentlib.lib.xmlrpc.requests_transport import RequestsTransport  # @UnresolvedImport @IgnorePep8
from rtorrentlib.lib.xmlrpc.scgi import SCGIServerProxy  # @UnresolvedImport
from rtorrentlib.rpc import Method  # @UnresolvedImport
from rtorrentlib.torrent import Torrent  # @UnresolvedImport

__version__ = "0.2.9"
__author__ = "Chris Lucas"
__contact__ = "*****@*****.**"
__license__ = "MIT"

MIN_RTORRENT_VERSION = (0, 8, 1)
MIN_RTORRENT_VERSION_STR = convert_version_tuple_to_str(MIN_RTORRENT_VERSION)
MAX_RETRIES = 5


class RTorrent:

    """ Create a new rTorrent connection """
    rpc_prefix = None

    def __init__(self, uri, username=None, password=None,
                 verify=False, sp=None, sp_kwargs=None, tp_kwargs=None):
        self.uri = uri  # : From X{__init__(self, url)}

        self.username = username
        self.password = password