@@ -27,11 +27,11 @@ def all_page_revisions(self, page_id):
27
27
return self ._request ("page/{}/revisions" , page_id )
28
28
29
29
def page_revisions (self , page_id , * ,
30
- limit = 20 , offset = 0 , direction = 'asc' ):
30
+ limit , offset , direction ):
31
31
data = {
32
- 'limit' : limit ,
33
- 'offset' : offset ,
34
- 'direction' : direction ,
32
+ 'limit' : 20 if limit is None else limit ,
33
+ 'offset' : 0 if offset is None else offset ,
34
+ 'direction' : 'asc' if direction is None else direction ,
35
35
}
36
36
return self ._request ("page/{}/revisions" , page_id , data )
37
37
@@ -56,33 +56,44 @@ def all_forums(self):
56
56
def forum (self , forum_id ):
57
57
return self ._request ("forum/{}" , forum_id )
58
58
59
- def forum_threads (self , forum_id , * ,
60
- since = None , limit = 20 , offset = 0 , direction = 'asc' ):
61
- if since is None :
62
- return self ._request ("forum/{}/threads" , forum_id )
63
- if isinstance (since , int ):
64
- data = {
65
- 'timestamp' : since ,
66
- 'limit' : limit ,
67
- 'offset' : offset ,
68
- 'direction' : direction ,
69
- }
70
- return self ._request ("forum/{}/since" , forum_id , data )
71
- raise TypeError ("`since` must be a UNIX timestamp" )
59
+ def forum_threads (self , forum_id ):
60
+ return self ._request ("forum/{}/threads" , forum_id )
61
+
62
+ def forum_threads_since (self , forum_id , since , * ,
63
+ limit , offset , direction ):
64
+ if not isinstance (since , int ):
65
+ raise TypeError ("`since` must be a UNIX timestamp" )
66
+ data = {
67
+ 'timestamp' : since ,
68
+ 'limit' : 20 if limit is None else limit ,
69
+ 'offset' : 0 if offset is None else offset ,
70
+ 'direction' : 'asc' if direction is None else direction ,
71
+ }
72
+ return self ._request ("forum/{}/since" , forum_id , data )
72
73
73
74
def thread (self , thread_id ):
74
75
return self ._request ("thread/{}" , thread_id )
75
76
77
+ def all_thread_posts (self , thread_id ):
78
+ return self ._request ("thread/{}/posts" , thread_id )
79
+
76
80
def thread_posts (self , thread_id , * ,
77
- since = None , limit = 20 , offset = 0 , direction = 'asc' ):
78
- if since is None :
79
- return self ._request ("thread/{}/posts" , thread_id )
81
+ limit , offset , direction ):
82
+ data = {
83
+ 'limit' : 20 if limit is None else limit ,
84
+ 'offset' : 0 if offset is None else offset ,
85
+ 'direction' : 'asc' if direction is None else direction ,
86
+ }
87
+ return self ._request ("thread/{}/posts" , thread_id , data )
88
+
89
+ def thread_posts_since (self , thread_id , since , * ,
90
+ limit , offset , direction ):
80
91
if isinstance (since , int ):
81
92
data = {
82
93
'timestamp' : since ,
83
- 'limit' : limit ,
84
- 'offset' : offset ,
85
- 'direction' : direction ,
94
+ 'limit' : 20 if limit is None else limit ,
95
+ 'offset' : 0 if offset is None else offset ,
96
+ 'direction' : 'asc' if direction is None else direction ,
86
97
}
87
98
return self ._request ("thread/{}/since" , thread_id , data )
88
99
raise TypeError ("`since` must be a UNIX timestamp" )
0 commit comments