Skip to content

Commit d13d769

Browse files
committed
Silly little PEP-8 fixes.
1 parent 307d736 commit d13d769

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

github2/core.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ def requires_auth(f):
100100
:param func f: Function to wrap
101101
:raises AuthError: If function called without an authenticated session
102102
"""
103-
# When Python 2.4 support is dropped move straight to functools.wraps, don't
104-
# pass go and don't collect $200.
103+
# When Python 2.4 support is dropped move straight to functools.wraps,
104+
# don't pass go and don't collect $200.
105105
def wrapper(self, *args, **kwargs):
106106
if not self.request.access_token and not self.request.api_token:
107107
raise AuthError("%r requires an authenticated session"
@@ -161,7 +161,8 @@ def get_value(self, *args, **kwargs):
161161
# unicode keys are not accepted as kwargs by python, see:
162162
#http://mail-archives.apache.org/mod_mbox/qpid-dev/200609.mbox/%[email protected]%3E
163163
# So we make a local dict with the same keys but as strings:
164-
return datatype(**dict((str(k), v) for (k, v) in value.iteritems()))
164+
return datatype(**dict((str(k), v)
165+
for (k, v) in value.iteritems()))
165166
return value
166167

167168
def get_values(self, *args, **kwargs):
@@ -170,7 +171,8 @@ def get_values(self, *args, **kwargs):
170171
if datatype:
171172
# Same as above, unicode keys will blow up in **args, so we need to
172173
# create a new 'values' dict with string keys
173-
return [datatype(**dict((str(k), v) for (k, v) in value.iteritems()))
174+
return [datatype(**dict((str(k), v)
175+
for (k, v) in value.iteritems()))
174176
for value in values]
175177
else:
176178
return values
@@ -273,7 +275,7 @@ def __getitem__(self, key):
273275
responses to ``BaseData`` derived objects.
274276
"""
275277
warn("Subscript access on %r is deprecated, use object attributes"
276-
% self.__class__.__name__, DeprecationWarning)
278+
% self.__class__.__name__, DeprecationWarning)
277279
if not key in self._meta.keys():
278280
raise KeyError(key)
279281
return getattr(self, key)
@@ -284,7 +286,7 @@ def __setitem__(self, key, value):
284286
:see: ``BaseData.__getitem__``
285287
"""
286288
warn("Subscript access on %r is deprecated, use object attributes"
287-
% self.__class__.__name__, DeprecationWarning)
289+
% self.__class__.__name__, DeprecationWarning)
288290
if not key in self._meta.keys():
289291
raise KeyError(key)
290292
setattr(self, key, value)

github2/issues.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ def list_by_label(self, project, label):
6868
:param str project: GitHub project
6969
:param str label: a string representing a label (e.g., ``bug``).
7070
"""
71-
return self.get_values("list", project, "label", label, filter="issues",
72-
datatype=Issue)
71+
return self.get_values("list", project, "label", label,
72+
filter="issues", datatype=Issue)
7373

7474
def list_labels(self, project):
7575
"""Get all labels for project.

github2/repositories.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Repository(BaseData):
1414
fork = Attribute("If True, this is a fork of another repository.")
1515
owner = Attribute("Username of the user owning this repository.")
1616
homepage = Attribute("Homepage for this project.")
17-
master_branch = Attribute("Default branch, if set.")
17+
master_branch = Attribute("Default branch, if set.")
1818
integration_branch = Attribute("Integration branch, if set.")
1919
open_issues = Attribute("List of open issues for this repository.")
2020
created_at = DateAttribute("Datetime the repository was created.")
@@ -64,7 +64,6 @@ def pushable(self):
6464
return self.get_values("pushable", filter="repositories",
6565
datatype=Repository)
6666

67-
6867
def list(self, user=None, page=1):
6968
"""Return a list of all repositories for a user.
7069
@@ -189,7 +188,8 @@ def languages(self, project):
189188
190189
:param str project: Github project
191190
"""
192-
return self.get_values("show", project, "languages", filter="languages")
191+
return self.get_values("show", project, "languages",
192+
filter="languages")
193193

194194
def tags(self, project):
195195
"""Get tags for project

github2/request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def __init__(self, username=None, api_token=None, url_prefix=None,
9090
"api_version": self.api_version,
9191
"api_format": self.api_format,
9292
}
93-
digicert_ha_cert = path.join(path.dirname(path.abspath(__file__ )),
93+
digicert_ha_cert = path.join(path.dirname(path.abspath(__file__)),
9494
"DigiCert_High_Assurance_EV_Root_CA.crt")
9595
if proxy_host is None:
9696
self._http = httplib2.Http(cache=cache, ca_certs=digicert_ha_cert)

0 commit comments

Comments
 (0)