Skip to content

Instantly share code, notes, and snippets.

@hluk hluk/pdc_client.py
Last active Sep 26, 2017

Embed
What would you like to do?
class PDCClientWrapper(object):
def __init__(self, client, page_size):
self.client = client
self.page_size = page_size
def __call__(self, *args, **kwargs):
if 'page_size' not in kwargs:
kwargs['page_size'] = self.page_size
return self.client(*args, **kwargs)
def __getattr__(self, name):
return PDCClientWrapper(self.client.__getattr__(name), self.page_size)
@xiangge

This comment has been minimized.

Copy link

commented Sep 26, 2017

from pdc_client import PDCClient
server= 'upstream'
client = PDCClient(server, page_size=1)
#client = PDCClient(server)
#print(client())
#print(client["releases"])
#print(client.get(session))
client1 = PDCClient(server, page_size=3)
print(client.releases.())
print(client1.releases.
())
#print(client["releases"].)
#print(client["releases"].
())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.