fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0425465
)
Error handling fix.
author
Radek Czajka
<rczajka@rczajka.pl>
Mon, 21 Aug 2023 12:01:36 +0000
(14:01 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Mon, 21 Aug 2023 12:01:36 +0000
(14:01 +0200)
src/depot/publishers/woblink.py
patch
|
blob
|
history
diff --git
a/src/depot/publishers/woblink.py
b/src/depot/publishers/woblink.py
index
c8037fa
..
8472a18
100644
(file)
--- a/
src/depot/publishers/woblink.py
+++ b/
src/depot/publishers/woblink.py
@@
-271,7
+271,7
@@
class Woblink(BasePublisher):
parts[1] = m.group(0) + parts[1]
opened = []
parts[1] = m.group(0) + parts[1]
opened = []
- for tag in re.findall(r'<[^>]
+
[^/>]>', parts[0]):
+ for tag in re.findall(r'<[^>]
*
[^/>]>', parts[0]):
if tag[1] == '/':
opened.pop()
else:
if tag[1] == '/':
opened.pop()
else:
@@
-288,7
+288,12
@@
class Woblink(BasePublisher):
return lang_code_3to2(meta.language)
def get_price(self, shop, wldoc, errors=None):
return lang_code_3to2(meta.language)
def get_price(self, shop, wldoc, errors=None):
- stats = wldoc.get_statistics()['total']
+ try:
+ stats = wldoc.get_statistics()['total']
+ except:
+ if errors:
+ errors.append(NoPrice(shop))
+ return 0
words = stats['words_with_fn']
pages = stats['chars_with_fn'] / 1800
price = shop.get_price(words, pages)
words = stats['words_with_fn']
pages = stats['chars_with_fn'] / 1800
price = shop.get_price(words, pages)