66
77from .base import BaseApi
88
9+
910class Api (BaseApi ):
1011 """API version 1"""
12+
1113 version = 1
1214
1315 def wikis (self ):
@@ -19,8 +21,9 @@ def wiki(self):
1921 def all_pages (self ):
2022 return self ._request ("page" )
2123
22- def all_pages_since (self , since , * ,
23- limit = None , offset = None , direction = None ):
24+ def all_pages_since (
25+ self , since , * , limit = None , offset = None , direction = None
26+ ):
2427 data = {
2528 'limit' : 20 if limit is None else limit ,
2629 'offset' : 0 if offset is None else offset ,
@@ -39,8 +42,9 @@ def page_by_slug(self, page_slug):
3942 def all_page_revisions (self , page_id ):
4043 return self ._request ("page/{}/revisions" , page_id )
4144
42- def page_revisions (self , page_id , * ,
43- limit = None , offset = None , direction = None ):
45+ def page_revisions (
46+ self , page_id , * , limit = None , offset = None , direction = None
47+ ):
4448 data = {
4549 'limit' : 20 if limit is None else limit ,
4650 'offset' : 0 if offset is None else offset ,
@@ -72,8 +76,9 @@ def forum(self, forum_id):
7276 def forum_threads (self , forum_id ):
7377 return self ._request ("forum/{}/threads" , forum_id )
7478
75- def forum_threads_since (self , forum_id , since , * ,
76- limit = None , offset = None , direction = None ):
79+ def forum_threads_since (
80+ self , forum_id , since , * , limit = None , offset = None , direction = None
81+ ):
7782 data = {
7883 'timestamp' : since ,
7984 'limit' : 20 if limit is None else limit ,
@@ -90,17 +95,19 @@ def thread(self, thread_id):
9095 def all_thread_posts (self , thread_id ):
9196 return self ._request ("thread/{}/posts" , thread_id )
9297
93- def thread_posts (self , thread_id , * ,
94- limit = None , offset = None , direction = None ):
98+ def thread_posts (
99+ self , thread_id , * , limit = None , offset = None , direction = None
100+ ):
95101 data = {
96102 'limit' : 20 if limit is None else limit ,
97103 'offset' : 0 if offset is None else offset ,
98104 'direction' : 'asc' if direction is None else direction ,
99105 }
100106 return self ._request ("thread/{}/posts" , thread_id , data )
101107
102- def thread_posts_since (self , thread_id , since , * ,
103- limit = None , offset = None , direction = None ):
108+ def thread_posts_since (
109+ self , thread_id , since , * , limit = None , offset = None , direction = None
110+ ):
104111 data = {
105112 'timestamp' : since ,
106113 'limit' : 20 if limit is None else limit ,
@@ -135,8 +142,9 @@ def all_wikidotuser_pages(self, wikidotuser_id):
135142 raise TypeError ("The Wikidot user ID must be an int" )
136143 return self ._request ("wikidotuser/{}/pages" , wikidotuser_id )
137144
138- def wikidotuser_pages (self , wikidotuser_id , * ,
139- limit = None , offset = None , direction = None ):
145+ def wikidotuser_pages (
146+ self , wikidotuser_id , * , limit = None , offset = None , direction = None
147+ ):
140148 data = {
141149 'limit' : 20 if limit is None else limit ,
142150 'offset' : 0 if offset is None else offset ,
@@ -151,8 +159,9 @@ def all_wikidotuser_posts(self, wikidotuser_id):
151159 raise TypeError ("The Wikidot user ID must be an int" )
152160 return self ._request ("wikidotuser/{}/posts" , wikidotuser_id )
153161
154- def wikidotuser_posts (self , wikidotuser_id , * ,
155- limit = None , offset = None , direction = None ):
162+ def wikidotuser_posts (
163+ self , wikidotuser_id , * , limit = None , offset = None , direction = None
164+ ):
156165 data = {
157166 'limit' : 20 if limit is None else limit ,
158167 'offset' : 0 if offset is None else offset ,
@@ -167,8 +176,9 @@ def all_wikidotuser_revisions(self, wikidotuser_id):
167176 raise TypeError ("The Wikidot user ID must be an int" )
168177 return self ._request ("wikidotuser/{}/revisions" , wikidotuser_id )
169178
170- def wikidotuser_revisions (self , wikidotuser_id , * ,
171- limit = None , offset = None , direction = None ):
179+ def wikidotuser_revisions (
180+ self , wikidotuser_id , * , limit = None , offset = None , direction = None
181+ ):
172182 data = {
173183 'limit' : 20 if limit is None else limit ,
174184 'offset' : 0 if offset is None else offset ,
@@ -194,8 +204,9 @@ def tag_pages(self, tags):
194204 raise TypeError ("A single tag must be a string" )
195205 return self ._request ("tag/{}/pages" , tags )
196206
197- def tags_pages (self , tags , operator = 'and' , * ,
198- limit = None , offset = None , direction = None ):
207+ def tags_pages (
208+ self , tags , operator = 'and' , * , limit = None , offset = None , direction = None
209+ ):
199210 """
200211 str[] `tags`: A list of tags, finds all page IDs that match the
201212 condition.
@@ -205,8 +216,9 @@ def tags_pages(self, tags, operator='and', *,
205216 multiple tags.
206217 """
207218 if isinstance (tags , str ):
208- raise TypeError ("tags must be str[] or int[]; use tag_pages()"
209- "for single tags" )
219+ raise TypeError (
220+ "tags must be str[] or int[]; use tag_pages()" "for single tags"
221+ )
210222 if not isinstance (tags , Iterable ):
211223 raise TypeError ("tags must be a list of str or int" )
212224 data = {
0 commit comments