Skip to content

Commit d4441b9

Browse files
committed
[QA] Use PEP 257 punctuation guidelines.
1 parent ec36b57 commit d4441b9

12 files changed

Lines changed: 90 additions & 90 deletions

github2/bin/manage_collaborators.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525

2626
def print_(text):
27-
"""Python 2 & 3 compatible print function
27+
"""Python 2 & 3 compatible print function.
2828
2929
We support <2.6, so can't use __future__.print_function
3030
@@ -36,7 +36,7 @@ def print_(text):
3636

3737

3838
def parse_commandline():
39-
"""Parse the comandline and return parsed options."""
39+
"""Parse the command line and return parsed options."""
4040

4141
parser = OptionParser()
4242
parser.description = __doc__
@@ -75,7 +75,7 @@ def parse_commandline():
7575

7676

7777
def main():
78-
"""This implements the actual program functionality"""
78+
"""Implement the actual program functionality."""
7979

8080
options, args = parse_commandline()
8181

github2/bin/search_repos.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818

1919
def print_(text):
20-
"""Python 2 & 3 compatible print function
20+
"""Python 2 & 3 compatible print function.
2121
2222
We support <2.6, so can't use __future__.print_function
2323
@@ -29,7 +29,7 @@ def print_(text):
2929

3030

3131
def parse_commandline():
32-
"""Parse the comandline and return parsed options."""
32+
"""Parse the command line and return parsed options."""
3333

3434
parser = OptionParser()
3535
parser.description = __doc__
@@ -48,7 +48,7 @@ def parse_commandline():
4848

4949

5050
def main():
51-
"""This implements the actual program functionality"""
51+
"""Implement the actual program functionality."""
5252
return_value = 0
5353

5454
options, term = parse_commandline()

github2/client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def __init__(self, username=None, api_token=None, requests_per_second=None,
5959
self.pull_requests = PullRequests(self.request)
6060

6161
def project_for_user_repo(self, user, repo):
62-
"""Return GitHub identifier for a user's repository
62+
"""Return Github identifier for a user's repository.
6363
6464
:param str user: repository owner
6565
:param str repo: repository name
@@ -68,7 +68,7 @@ def project_for_user_repo(self, user, repo):
6868
return "/".join([user, repo])
6969

7070
def get_all_blobs(self, project, tree_sha):
71-
"""Get a list of all blobs for a specific tree
71+
"""Get a list of all blobs for a specific tree.
7272
7373
.. versionadded:: 0.3.0
7474
@@ -80,7 +80,7 @@ def get_all_blobs(self, project, tree_sha):
8080
return blobs.get("blobs")
8181

8282
def get_blob_info(self, project, tree_sha, path):
83-
"""Get the blob for a file within a specific tree
83+
"""Get the blob for a file within a specific tree.
8484
8585
:param str project: GitHub project
8686
:param str tree_sha: object ID of tree
@@ -91,7 +91,7 @@ def get_blob_info(self, project, tree_sha, path):
9191
return blob.get("blob")
9292

9393
def get_tree(self, project, tree_sha):
94-
"""Get tree information for a specifc tree
94+
"""Get tree information for a specifc tree.
9595
9696
:param str project: GitHub project
9797
:param str tree_sha: object ID of tree
@@ -101,7 +101,7 @@ def get_tree(self, project, tree_sha):
101101
return tree.get("tree", [])
102102

103103
def get_network_meta(self, project):
104-
"""Get GitHub metadata associated with a project
104+
"""Get Github metadata associated with a project.
105105
106106
:param str project: GitHub project
107107
@@ -111,7 +111,7 @@ def get_network_meta(self, project):
111111
"network_meta"]), {})
112112

113113
def get_network_data(self, project, nethash, start=None, end=None):
114-
"""Get chunk of GitHub network data
114+
"""Get chunk of Github network data.
115115
116116
:param str project: GitHub project
117117
:param str nethash: identifier provided by :meth:`get_network_meta`

github2/commits.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Commits(GithubCommand):
2828
domain = "commits"
2929

3030
def list(self, project, branch="master", file=None, page=1):
31-
"""List commits on a project
31+
"""List commits on a project.
3232
3333
.. warning::
3434
Not all projects use ``master`` as their default branch, you can
@@ -45,7 +45,7 @@ def list(self, project, branch="master", file=None, page=1):
4545
datatype=Commit, page=page)
4646

4747
def show(self, project, sha):
48-
"""Get a specific commit
48+
"""Get a specific commit.
4949
5050
:param str project: project name
5151
:param str sha: commit id

github2/core.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828

2929
def string_to_datetime(string):
30-
"""Convert a string to Python datetime
30+
"""Convert a string to Python datetime.
3131
3232
:param str github_date: date string to parse
3333
@@ -39,7 +39,7 @@ def string_to_datetime(string):
3939

4040

4141
def _handle_naive_datetimes(f):
42-
"""Decorator to make datetime arguments use GitHub timezone
42+
"""Decorator to make datetime arguments use GitHub timezone.
4343
4444
:param func f: Function to wrap
4545
@@ -61,7 +61,7 @@ def wrapper(datetime_):
6161

6262
@_handle_naive_datetimes
6363
def datetime_to_ghdate(datetime_):
64-
"""Convert Python datetime to GitHub date string
64+
"""Convert Python datetime to Github date string.
6565
6666
:param datetime datetime_: datetime object to convert
6767
@@ -71,7 +71,7 @@ def datetime_to_ghdate(datetime_):
7171

7272
@_handle_naive_datetimes
7373
def datetime_to_commitdate(datetime_):
74-
"""Convert Python datetime to GitHub date string
74+
"""Convert Python datetime to Github date string.
7575
7676
:param datetime datetime_: datetime object to convert
7777
@@ -84,12 +84,11 @@ def datetime_to_commitdate(datetime_):
8484

8585

8686
def datetime_to_isodate(datetime_):
87-
"""Convert Python datetime to GitHub date string
88-
89-
.. note:: Supports naive and timezone-aware datetimes
87+
"""Convert Python datetime to Github date string.
9088
9189
:param str datetime_: datetime object to convert
9290
91+
.. note:: Supports naive and timezone-aware datetimes
9392
"""
9493
if not datetime_.tzinfo:
9594
datetime_ = datetime_.replace(tzinfo=tz.tzutc())
@@ -104,7 +103,7 @@ class AuthError(Exception):
104103

105104

106105
def requires_auth(f):
107-
"""Decorate to check a function call for authentication
106+
"""Decorate to check a function call for authentication.
108107
109108
Sets a ``requires_auth`` attribute on functions, for use in introspection.
110109
@@ -129,7 +128,7 @@ def wrapper(self, *args, **kwargs):
129128

130129

131130
def enhanced_by_auth(f):
132-
"""Decorator to mark a function as enhanced by authentication
131+
"""Decorator to mark a function as enhanced by authentication.
133132
134133
Sets a ``enhanced_by_auth`` attribute on functions, for use in
135134
introspection.
@@ -145,15 +144,15 @@ def enhanced_by_auth(f):
145144
class GithubCommand(object):
146145

147146
def __init__(self, request):
148-
"""Main API binding interface
147+
"""Main API binding interface.
149148
150149
:param github2.request.GithubRequest request: HTTP request handler
151150
152151
"""
153152
self.request = request
154153

155154
def make_request(self, command, *args, **kwargs):
156-
"""Make an API request
155+
"""Make an API request.
157156
158157
Various options are supported if they exist in ``kwargs``:
159158
@@ -187,7 +186,7 @@ def make_request(self, command, *args, **kwargs):
187186
return response
188187

189188
def get_value(self, *args, **kwargs):
190-
"""Process a single-value response from the API
189+
"""Process a single-value response from the API.
191190
192191
If a ``datatype`` parameter is given it defines the
193192
:class:`BaseData`-derived class we should build from the provided data
@@ -207,7 +206,7 @@ def get_value(self, *args, **kwargs):
207206
return value
208207

209208
def get_values(self, *args, **kwargs):
210-
"""Process a multi-value response from the API
209+
"""Process a multi-value response from the API.
211210
212211
:see: :meth:`get_value`
213212
@@ -228,7 +227,7 @@ def get_values(self, *args, **kwargs):
228227

229228

230229
def doc_generator(docstring, attributes):
231-
"""Utility function to augment BaseDataType docstring
230+
"""Utility function to augment BaseDataType docstring.
232231
233232
:param str docstring: docstring to augment
234233
:param dict attributes: attributes to add to docstring
@@ -246,7 +245,7 @@ def bullet(title, text):
246245

247246
class Attribute(object):
248247
def __init__(self, help):
249-
"""Generic object attribute for use with :class:`BaseData`
248+
"""Generic object attribute for use with :class:`BaseData`.
250249
251250
:param str help: Attribute description
252251
@@ -269,7 +268,7 @@ class DateAttribute(Attribute):
269268
}
270269

271270
def __init__(self, *args, **kwargs):
272-
"""Date handling attribute for use with :class:`BaseData`
271+
"""Date handling attribute for use with :class:`BaseData`.
273272
274273
:param str format: The date format to support, see
275274
:data:`convertor_for_format` for supported options
@@ -327,7 +326,8 @@ def iterate(self):
327326
# Ugly base class definition for Python 2 and 3 compatibility, where metaclass
328327
# syntax is incompatible
329328
class BaseData(BaseDataType('BaseData', (object, ), {})):
330-
"""Wrapper for API responses
329+
330+
"""Wrapper for API responses.
331331
332332
.. warning::
333333
Supports subscript attribute access purely for backwards compatibility,
@@ -336,7 +336,7 @@ class BaseData(BaseDataType('BaseData', (object, ), {})):
336336
"""
337337

338338
def __getitem__(self, key):
339-
"""Access objects's attribute using subscript notation
339+
"""Access objects's attribute using subscript notation.
340340
341341
This is here purely to maintain compatibility when switching ``dict``
342342
responses to ``BaseData`` derived objects.
@@ -350,7 +350,7 @@ def __getitem__(self, key):
350350
return getattr(self, key)
351351

352352
def __setitem__(self, key, value):
353-
"""Update object's attribute using subscript notation
353+
"""Update object's attribute using subscript notation.
354354
355355
:see: :meth:`BaseData.__getitem__`
356356
@@ -364,7 +364,7 @@ def __setitem__(self, key, value):
364364

365365

366366
def repr_string(string):
367-
"""Shorten string for use in repr() output
367+
"""Shorten string for use in repr() output.
368368
369369
:param str string: string to operate on
370370
:return: string, with maximum length of 20 characters

github2/issues.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def search(self, project, term, state="open"):
4848
4949
:param str project: GitHub project
5050
:param str term: term to search issues for
51-
:param str state: can be either ``open`` or ``closed``.
51+
:param str state: can be either ``open`` or ``closed``
5252
5353
"""
5454
return self.get_values("search", project, state, quote_plus(term),
@@ -58,7 +58,7 @@ def list(self, project, state="open"):
5858
"""Get all issues for project with given state.
5959
6060
:param str project: GitHub project
61-
:param str state: can be either ``open`` or ``closed``.
61+
:param str state: can be either ``open`` or ``closed``
6262
6363
"""
6464
return self.get_values("list", project, state, filter="issues",
@@ -70,7 +70,7 @@ def list_by_label(self, project, label):
7070
.. versionadded:: 0.3.0
7171
7272
:param str project: GitHub project
73-
:param str label: a string representing a label (e.g., ``bug``).
73+
:param str label: a string representing a label (e.g., ``bug``)
7474
7575
"""
7676
return self.get_values("list", project, "label", label,
@@ -111,7 +111,7 @@ def open(self, project, title, body):
111111

112112
@requires_auth
113113
def close(self, project, number):
114-
"""Close an issue
114+
"""Close an issue.
115115
116116
:param str project: GitHub project
117117
:param int number: issue number in the Github database
@@ -122,7 +122,7 @@ def close(self, project, number):
122122

123123
@requires_auth
124124
def reopen(self, project, number):
125-
"""Reopen a closed issue
125+
"""Reopen a closed issue.
126126
127127
.. versionadded:: 0.3.0
128128
@@ -135,7 +135,7 @@ def reopen(self, project, number):
135135

136136
@requires_auth
137137
def edit(self, project, number, title, body):
138-
"""Edit an existing issue
138+
"""Edit an existing issue.
139139
140140
.. versionadded:: 0.3.0
141141
@@ -152,7 +152,7 @@ def edit(self, project, number, title, body):
152152

153153
@requires_auth
154154
def add_label(self, project, number, label):
155-
"""Add a label to an issue
155+
"""Add a label to an issue.
156156
157157
:param str project: GitHub project
158158
:param int number: issue number in the GitHub database
@@ -164,7 +164,7 @@ def add_label(self, project, number, label):
164164

165165
@requires_auth
166166
def remove_label(self, project, number, label):
167-
"""Remove an existing label from an issue
167+
"""Remove an existing label from an issue.
168168
169169
:param str project: GitHub project
170170
:param int number: issue number in the GitHub database

0 commit comments

Comments
 (0)