mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
bdf2cd48dd
commit
21731b3c04
@ -9,7 +9,7 @@ __contributors__ = ["Martin 'Joey' Schulze", "Ricardo Reyes", "Kevin Jay North"]
|
|||||||
# Support decoded entities with unifiable.
|
# Support decoded entities with unifiable.
|
||||||
|
|
||||||
if not hasattr(__builtins__, 'True'): True, False = 1, 0
|
if not hasattr(__builtins__, 'True'): True, False = 1, 0
|
||||||
import re, sys, urllib, htmlentitydefs, codecs, StringIO, types
|
import re, sys, urllib, htmlentitydefs, codecs
|
||||||
import sgmllib
|
import sgmllib
|
||||||
import urlparse
|
import urlparse
|
||||||
sgmllib.charref = re.compile('&#([xX]?[0-9a-fA-F]+)[^0-9a-fA-F]')
|
sgmllib.charref = re.compile('&#([xX]?[0-9a-fA-F]+)[^0-9a-fA-F]')
|
||||||
@ -18,17 +18,17 @@ try: from textwrap import wrap
|
|||||||
except: pass
|
except: pass
|
||||||
|
|
||||||
# Use Unicode characters instead of their ascii psuedo-replacements
|
# Use Unicode characters instead of their ascii psuedo-replacements
|
||||||
UNICODE_SNOB = 0
|
UNICODE_SNOB = 1
|
||||||
|
|
||||||
# Put the links after each paragraph instead of at the end.
|
# Put the links after each paragraph instead of at the end.
|
||||||
LINKS_EACH_PARAGRAPH = 0
|
LINKS_EACH_PARAGRAPH = 0
|
||||||
|
|
||||||
# Wrap long lines at position. 0 for no wrapping. (Requires Python 2.3.)
|
# Wrap long lines at position. 0 for no wrapping. (Requires Python 2.3.)
|
||||||
BODY_WIDTH = 78
|
BODY_WIDTH = 0
|
||||||
|
|
||||||
# Don't show internal links (href="#local-anchor") -- corresponding link targets
|
# Don't show internal links (href="#local-anchor") -- corresponding link targets
|
||||||
# won't be visible in the plain text file anyway.
|
# won't be visible in the plain text file anyway.
|
||||||
SKIP_INTERNAL_LINKS = False
|
SKIP_INTERNAL_LINKS = True
|
||||||
|
|
||||||
### Entity Nonsense ###
|
### Entity Nonsense ###
|
||||||
|
|
||||||
@ -433,6 +433,7 @@ if __name__ == "__main__":
|
|||||||
j = urllib.urlopen(baseurl)
|
j = urllib.urlopen(baseurl)
|
||||||
try:
|
try:
|
||||||
from feedparser import _getCharacterEncoding as enc
|
from feedparser import _getCharacterEncoding as enc
|
||||||
|
enc
|
||||||
except ImportError:
|
except ImportError:
|
||||||
enc = lambda x, y: ('utf-8', 1)
|
enc = lambda x, y: ('utf-8', 1)
|
||||||
text = j.read()
|
text = j.read()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user