File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 from urllib import quote as urlquote
1313
1414import os .path
15+ import warnings
16+
1517
1618class AtWikiURI (object ):
1719 def __init__ (self , base ):
@@ -115,8 +117,23 @@ def diff(self, page_id):
115117 def word (self , page_id , keyword ):
116118 return '{0}/?cmd=word&pageid={1}&word={2}&type=normal' .format (self ._base , page_id , urlquote (keyword ))
117119
118- def edit (self , page_id , menu = True ):
119- mode = 'editx' if menu else 'editxx'
120+ def edit (self , page_id , menu = None , mode = None ):
121+ if menu is not None :
122+ warnings .warn (
123+ '`menu` option will be removed in the future release. Use `mode` option instead.' ,
124+ DeprecationWarning )
125+ else :
126+ menu = True
127+
128+ if mode is None :
129+ mode = 'editx' if menu else 'editxx'
130+
131+ if mode not in [
132+ 'pedit' , # standard
133+ 'editx' , # simple (with menu)
134+ 'editxx' , # simple (without menu)
135+ ]:
136+ raise ValueError ('invalid mode: {}' .format (mode ))
120137 return '{0}/{1}/{2}.html' .format (self ._base , mode , page_id )
121138
122139 def rename (self , page_id ):
You can’t perform that action at this time.
0 commit comments