mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Since commit 2c14587b88
, the sample
hooks.py file in the ELinks distribution will fail with an ImportError exception for any user who hasn't also installed contrib/python/lp3.py. For the benefit of users who may not otherwise need that file, I'd suggest delaying the import of lp3 until it's actually used so that the rest of hooks.py will still work without it.
This commit is contained in:
parent
ece4bfcc28
commit
b41e738905
@ -24,7 +24,6 @@ quit_hook() -- Clean up before ELinks exits.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
import elinks
|
import elinks
|
||||||
from lp3 import lp3
|
|
||||||
|
|
||||||
dumbprefixes = {
|
dumbprefixes = {
|
||||||
"7th" : "http://7thguard.net/",
|
"7th" : "http://7thguard.net/",
|
||||||
@ -97,7 +96,8 @@ def pre_format_html_hook(url, html):
|
|||||||
elif url.startswith("https://www.mbank.com.pl/ib_navibar_3.asp"):
|
elif url.startswith("https://www.mbank.com.pl/ib_navibar_3.asp"):
|
||||||
return html.replace('<td valign="top"><img',
|
return html.replace('<td valign="top"><img',
|
||||||
'<tr><td valign="top"><img')
|
'<tr><td valign="top"><img')
|
||||||
if url.startswith("http://lp3.polskieradio.pl/"):
|
elif url.startswith("http://lp3.polskieradio.pl/"):
|
||||||
|
from lp3 import lp3
|
||||||
return lp3(html)
|
return lp3(html)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user