CapPaste: Support expiration for posting, as a max_age parameter

This commit is contained in:
Laurent Bachelier 2011-04-30 00:26:23 +02:00
commit f63180c187
10 changed files with 71 additions and 27 deletions

View file

@ -66,9 +66,9 @@ class PastealaconBrowser(BaseBrowser):
except BrowserHTTPNotFound:
raise PasteNotFound()
def post_paste(self, paste):
def post_paste(self, paste, expiration=None):
self.home()
self.page.post(paste)
self.page.post(paste, expiration=expiration)
if self.is_on_page(CaptchaPage):
raise BrowserUnavailable("Detected as spam and unable to handle the captcha")
paste.id = self.page.get_id()