use string template for interpolation
This commit is contained in:
parent
be3c07f6bd
commit
2a1ca0a0a4
|
@ -9,6 +9,7 @@ import imaplib
|
|||
import os
|
||||
import os.path
|
||||
import requests
|
||||
import string
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
|
@ -53,7 +54,9 @@ def process(cfg, filename, payload, enable_ocr=True):
|
|||
else:
|
||||
print ' uploading file'
|
||||
now = datetime.datetime.now()
|
||||
title = cfg.get('title') % {'date': now.strftime('%d/%m/%Y'), 'time': now.strftime('%H:%M')}
|
||||
title = string.Template(cfg.get('title')).substitute(
|
||||
{'date': now.strftime('%d/%m/%Y'),
|
||||
'time': now.strftime('%H:%M')})
|
||||
t = os.system('curl -v --insecure -X POST '\
|
||||
'--form "form.widgets.file=@%s;filename=%s;type=application/pdf" '\
|
||||
'-F "form.buttons.import=Import" '\
|
||||
|
|
Reference in New Issue