books_ids.append(bid)
if books_ids:
download_path = get_config().getpath('download', 'path')
- for bid in books_ids:
- book = Book.get(int(bid))
- download(book, download_path)
- return {
- 'message': u'Книги сохранены.',
- }
+ try:
+ for bid in books_ids:
+ book = Book.get(int(bid))
+ download(book, download_path)
+ except Exception as e:
+ return {
+ 'error': str(e),
+ }
+ else:
+ return {
+ 'message': u'Книги сохранены.',
+ }
else:
return {
- 'message': u'Не выбрано книг для сохранения.',
+ 'error': u'Не выбрано книг для сохранения.',
}
VFSL=valueFromSearchList
VFN=valueForName
currentTime=time.time
-__CHEETAH_version__ = '3.1.0'
-__CHEETAH_versionTuple__ = (3, 1, 0, 'final', 1)
-__CHEETAH_genTime__ = 1523146500.915016
-__CHEETAH_genTimestamp__ = 'Sun Apr 8 03:15:00 2018'
+__CHEETAH_version__ = '3.3.1'
+__CHEETAH_versionTuple__ = (3, 3, 1, 'final', 0)
+__CHEETAH_genTime__ = 1704845598.39619
+__CHEETAH_genTimestamp__ = 'Wed Jan 10 03:13:18 2024'
__CHEETAH_src__ = 'download.tmpl'
-__CHEETAH_srcLastModified__ = 'Sun Apr 8 03:14:43 2018'
+__CHEETAH_srcLastModified__ = 'Wed Jan 10 03:10:53 2024'
__CHEETAH_docstring__ = 'Autogenerated by Cheetah: The Python-Powered Template Engine'
if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple:
if _v is not None: write(_filter(_v, rawExpr=u'$title')) # from line 5, col 5.
write(u'''</h1>
-<p>''')
- _v = VFFSL(SL,"message",True) # u'$message' on line 7, col 4
- if _v is not None: write(_filter(_v, rawExpr=u'$message')) # from line 7, col 4.
- write(u'''</p>
+''')
+ if VFFSL(SL,"getVar",False)('error', None): # generated from line 7, col 1
+ write(u'''<p style="color: red">''')
+ _v = VFFSL(SL,"error",True) # u'$error' on line 8, col 23
+ if _v is not None: write(_filter(_v, rawExpr=u'$error')) # from line 8, col 23.
+ write(u'''</p>
+''')
+ else: # generated from line 9, col 1
+ write(u'''<p>''')
+ _v = VFFSL(SL,"message",True) # u'$message' on line 10, col 4
+ if _v is not None: write(_filter(_v, rawExpr=u'$message')) # from line 10, col 4.
+ write(u'''</p>
''')
########################################
# CHEETAH was developed by Tavis Rudd and Mike Orr
# with code, advice and input from many other volunteers.
-# For more information visit http://cheetahtemplate.org/
+# For more information visit https://cheetahtemplate.org/
##################################################
## if run from command line: