0002-evalutils-add-attachment-content-filename-content_ty.patch
wcs/qommon/evalutils.py | ||
---|---|---|
118 | 118 |
today = make_datetime(today) |
119 | 119 |
return datetime_delta(today, born).total_seconds() |
120 | 120 | |
121 | ||
121 | 122 |
def add_days(date, count): |
122 | 123 |
'''Add the given number of days to date''' |
123 | 124 |
return make_date(date) + datetime.timedelta(days=count) |
125 | ||
126 | ||
127 |
def attachment(content, filename='', content_type='application/octet-stream'): |
|
128 |
'''Serialize content as an attachment''' |
|
129 |
import base64 |
|
130 | ||
131 |
return { |
|
132 |
'filename': filename, |
|
133 |
'content_type': content_type, |
|
134 |
'b64_content': base64.b64encode(content), |
|
135 |
} |
|
136 | ||
124 |
- |