From ed0b5d17d537e9d075c934edb8b4ccb4baa88778 Mon Sep 17 00:00:00 2001 From: David Medina Date: Sun, 4 Mar 2012 10:37:41 +0100 Subject: Wrap result getter into partial. It's cleaner --- pygithub3/core/result.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'pygithub3/core') diff --git a/pygithub3/core/result.py b/pygithub3/core/result.py index 0c44b1b..c2928d2 100644 --- a/pygithub3/core/result.py +++ b/pygithub3/core/result.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- encoding: utf-8 -*- -from urlparse import urlparse, parse_qs +import functools from .link import Link @@ -10,9 +10,8 @@ class Method(object): """ Lazy support """ def __init__(self, method, request, **method_args): - self.method = method - self.request = request - self.args = method_args + self.method = functools.partial(method, request, **method_args) + self.resource = request.resource self.cache = {} def cached(func): -- cgit v1.2.3-59-g8ed1b