forked from sigmavirus24/github3.py
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
38 lines (26 loc) · 856 Bytes
/
__init__.py
File metadata and controls
38 lines (26 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
github3.issues
==============
This module contains the classes related to issues.
See also: http://developer.github.com/v3/issues/
"""
from ..utils import timestamp_parameter
from .issue import Issue
from .issue import ShortIssue
__all__ = ["Issue", "ShortIssue"]
def issue_params(filter, state, labels, sort, direction, since):
params = {}
if filter in ("assigned", "created", "mentioned", "subscribed", "all"):
params["filter"] = filter
if state in ("open", "closed", "all"):
params["state"] = state
if labels:
params["labels"] = labels
if sort in ("created", "updated", "comments"):
params["sort"] = sort
if direction in ("asc", "desc"):
params["direction"] = direction
since = timestamp_parameter(since)
if since:
params["since"] = since
return params