+ # will make problems in conjunction with paid previews
+ def download_pictures(self, remote_gallery_url):
+ gallery_path = self.gallery_path()
+ # delete previous files, so we don't include old files in ebooks
+ if os.path.isdir(gallery_path):
+ for filename in os.listdir(gallery_path):
+ file_path = os.path.join(gallery_path, filename)
+ os.unlink(file_path)
+ ilustr_elements = list(self.wldocument().edoc.findall('//ilustr'))
+ if ilustr_elements:
+ makedirs(gallery_path)
+ for ilustr in ilustr_elements:
+ ilustr_src = ilustr.get('src')
+ ilustr_path = os.path.join(gallery_path, ilustr_src)
+ urllib.urlretrieve('%s/%s' % (remote_gallery_url, ilustr_src), ilustr_path)
+
+ def load_abstract(self):
+ abstract = self.wldocument(parse_dublincore=False).edoc.getroot().find('.//abstrakt')
+ if abstract is not None:
+ self.abstract = transform_abstrakt(abstract)
+ else:
+ self.abstract = ''