Browse Source

handle exceptions

add-quote-import
Michael Murtaugh 9 years ago
parent
commit
30c9247518
  1. 5
      etherdump
  2. 3
      linkify.py

5
etherdump

@ -101,6 +101,8 @@ while len(todo) > 0:
except OSError:
pass
try:
# _
# _ __ ___ ___| |_ __ _
# | '_ ` _ \ / _ \ __/ _` |
@ -184,6 +186,7 @@ while len(todo) > 0:
for l in links:
if l not in todo and l not in done:
if l.startswith("http://") or l.startswith("https://"):
if args.verbose:
print ("Ignoring absolute URL in [[ link ]] form", file=sys.stderr)
continue
# if args.verbose:
@ -269,3 +272,5 @@ while len(todo) > 0:
count += 1
if args.limit and count >= args.limit:
break
except TypeError:
print ("ERROR, skipping!", file=sys.stderr)

3
linkify.py

@ -26,7 +26,8 @@ def linkify (src, urlify=urlify):
# src = re.sub(r"\[\[([\w_\- ,]+?)\]\]", s, src)
## question marks are ignored by etherpad, so split/strip it
src = re.sub(r"\[\[(.+?)(\?.*)?\]\]", s, src)
## strip slashes as well!! (/timeslider)
src = re.sub(r"\[\[(.+?)(\/.*)?(\?.*)?\]\]", s, src)
return (src, collect)

Loading…
Cancel
Save