# Path: model/torrentfile.py
# class TorrentFile(object):
#     def __init__(self, target):
#     def hacks(self):
#     def query(self):
# 
# Path: lib/baserequester.py
# class BaseRequester(object):
# class DictAttribute(dict):
#     def __init__(self, target, *extra_args):
#     def __hash__(self):
#     def __call__(self, *args):
#     def __getattr__(self, attr):
#     def append_command(self, command):
#     def _fetch(self):
#     def all(self):
#     def as_list(self):
#     def flush(self):
#     def __getattr__(self, attr):
# 
# Path: config.py
# BASE_URL = '/torrent'
# STATIC_URL = BASE_URL + '/static'
# USE_OWN_HTTPD = False
# FILE_BLOCK_SIZE = 4096
# BACKGROUND_IMAGE = 'cat.jpg'
# USE_AUTH = True
# ENABLE_API = False
# CACHE_TIMEOUT=10


import xmlrpc.client
from model import torrentfile
from lib.baserequester import BaseRequester, \
    InvalidTorrentCommandException
from config import rtorrent_config
    t = TorrentRequester('hostname')
    t.get_name().get_hash() # Chaining commands is possible
    t.get_upload_throttle() # As well as calling another method on it.
    print t.all()

"""
# Also change return type? not list of list but perhaps a dict or class?
# Properly implement flush?



# XXX: Create baseclass for rtorrent-multicall's. BaseRequester

class TorrentFileRequester(BaseRequester):
    """
    """
    def __init__(self, target, *first_args):
        BaseRequester.__init__(self, target, first_args)
        self.first_args = first_args

    def dofetch(self, *rpc_commands):
        return self.s.f.multicall(*(self.first_args + ('',) + rpc_commands))

    def _convert_command(self, command):
        """
        Convert command based on torrent._rpc_methods to rtorrent command.
        """
        if command in torrentfile._rpc_methods:
            return torrentfile._rpc_methods[command][0]
        else:

# Path: model/torrentfile.py
# class TorrentFile(object):
#     def __init__(self, target):
#     def hacks(self):
#     def query(self):
# 
# Path: lib/baserequester.py
# class BaseRequester(object):
# class DictAttribute(dict):
#     def __init__(self, target, *extra_args):
#     def __hash__(self):
#     def __call__(self, *args):
#     def __getattr__(self, attr):
#     def append_command(self, command):
#     def _fetch(self):
#     def all(self):
#     def as_list(self):
#     def flush(self):
#     def __getattr__(self, attr):
# 
# Path: config.py
# BASE_URL = '/torrent'
# STATIC_URL = BASE_URL + '/static'
# USE_OWN_HTTPD = False
# FILE_BLOCK_SIZE = 4096
# BACKGROUND_IMAGE = 'cat.jpg'
# USE_AUTH = True
# ENABLE_API = False
# CACHE_TIMEOUT=10


# Path: lib/filerequester.py
import xmlrpc.client
from model import torrentfile
from lib.baserequester import BaseRequester, \
    InvalidTorrentCommandException
from config import rtorrent_config

    t = TorrentRequester('hostname')
    t.get_name().get_hash() # Chaining commands is possible
    t.get_upload_throttle() # As well as calling another method on it.
    print t.all()

"""
# Also change return type? not list of list but perhaps a dict or class?
# Properly implement flush?



# XXX: Create baseclass for rtorrent-multicall's. BaseRequester

class TorrentFileRequester(BaseRequester):
    """
    """
    def __init__(self, target, *first_args):
        BaseRequester.__init__(self, target, first_args)
        self.first_args = first_args

    def dofetch(self, *rpc_commands):
        return self.s.f.multicall(*(self.first_args + ('',) + rpc_commands))

    def _convert_command(self, command):
        """
        Convert command based on torrent._rpc_methods to rtorrent command.
        """
        if command in torrentfile._rpc_methods:
            return torrentfile._rpc_methods[command][0]
        else:

            raise InvalidTorrentCommandException("%s is not a valid command" %