# Path: model/peer.py
# class Peer(object):
#     def __init__(self, target):
#     def hacks(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):


import xmlrpc.client
from model import peer
from lib.baserequester import BaseRequester, InvalidTorrentCommandException
"""
.. _peerrequester-class:

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


class PeerRequester(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.p.multicall(*(self.first_args + (' ',) + rpc_commands))

    def _convert_command(self, command):
        """
        Convert command based on torrent._rpc_methods to rtorrent command.
        """

# Path: model/peer.py
# class Peer(object):
#     def __init__(self, target):
#     def hacks(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: lib/peerrequester.py
import xmlrpc.client
from model import peer
from lib.baserequester import BaseRequester, InvalidTorrentCommandException

"""
.. _peerrequester-class:

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


class PeerRequester(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.p.multicall(*(self.first_args + (' ',) + rpc_commands))

    def _convert_command(self, command):
        """
        Convert command based on torrent._rpc_methods to rtorrent command.
        """

        if command in peer._rpc_methods: