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
|
|
@ -48,10 +48,11 @@ class PastePage(BasePage):
|
|||
|
||||
|
||||
class PostPage(BasePage):
|
||||
def post(self, paste):
|
||||
def post(self, paste, expiration=None):
|
||||
self.browser.select_form(name='myform')
|
||||
self.browser['paste_code'] = paste.contents.encode(self.browser.ENCODING)
|
||||
self.browser['paste_name'] = paste.title.encode(self.browser.ENCODING)
|
||||
self.browser['paste_private'] = ['0' if paste.public else '1']
|
||||
self.browser['paste_expire_date'] = ['1M']
|
||||
if expiration:
|
||||
self.browser['paste_expire_date'] = [expiration]
|
||||
self.browser.submit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue