unsee: use get_closest_expiration

This commit is contained in:
Vincent A 2014-02-19 17:15:57 +01:00 committed by Florent
commit ec6e5be528
2 changed files with 13 additions and 11 deletions

View file

@ -77,13 +77,7 @@ class UnseeBrowser(BaseBrowser):
headers = {'Content-type': 'multipart/form-data; boundary=%s' % b, 'Content-length': len(data)}
return Request(url, data=self._make_multipart(fields, b), headers=headers)
def post_image(self, name, contents, max_age):
if max_age >= 86400:
time = 'week'
elif max_age >= 3600:
time = 'day'
else:
time = 'hour'
def post_image(self, name, contents, time):
# time='first' for one-shot view
params = [('time', time), ('image[]', FileField(name or '-', contents))]