CapPaste: Support expiration for posting, as a max_age parameter
This commit is contained in:
parent
a9220c96af
commit
f63180c187
10 changed files with 71 additions and 27 deletions
|
|
@ -47,11 +47,12 @@ class PastePage(BasePage):
|
|||
return self.group_dict['id']
|
||||
|
||||
class PostPage(BasePage):
|
||||
def post(self, paste):
|
||||
def post(self, paste, expiration=None):
|
||||
self.browser.select_form(name='editor')
|
||||
self.browser['code2'] = paste.contents.encode(self.browser.ENCODING)
|
||||
self.browser['poster'] = paste.title.encode(self.browser.ENCODING)
|
||||
self.browser['expiry'] = ['m']
|
||||
if expiration:
|
||||
self.browser['expiry'] = [expiration]
|
||||
self.browser.submit()
|
||||
|
||||
class CaptchaPage(BasePage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue