def auth(self, sandbox=False): if sandbox: self.api = Bitreserve(host='api-sandbox.bitreserve.org') else: self.api = Bitreserve() pat = auth.get('pat', None) user = auth.get('user', None) password = auth.get('password', None) if pat: self.api.auth_pat(pat) elif user and password: self.api.auth(user, password)
def __init__(self, config_file, currencies, base_currency, DEBUG=False): """ Create the Broker object :param String config_file The path to a config file that ConfigParser can read and that has a "Broker" section. """ self.version = 0 config = ConfigParser.ConfigParser() config.read(config_file) self.api = Bitreserve() self.api.auth_pat(config.get('Broker', 'pat')) self.currencies = currencies self.base_currency = base_currency self.DEBUG = DEBUG self.pp = pprint.PrettyPrinter()