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
36 lines (24 loc) · 796 Bytes
/
Copy path__init__.py
File metadata and controls
36 lines (24 loc) · 796 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
"""
github3.issues
==============
This module contains the classes related to issues.
See also: http://developer.github.com/v3/issues/
"""
from re import match
from .issue import Issue
__all__ = [Issue]
def issue_params(filter, state, labels, sort, direction, since):
params = {}
if filter in ('assigned', 'created', 'mentioned', 'subscribed'):
params['filter'] = filter
if state in ('open', 'closed'):
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
if since and match('\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$', since):
params['since'] = since
return params