Fix #772267 (TXT to EPUB: Underlined words (following quotes?) fail to become italics) and fix bug when killing threaded jobs

This commit is contained in:
Kovid Goyal 2011-04-28 08:11:35 -06:00
commit df074821c4
2 changed files with 22 additions and 22 deletions

View File

@ -156,17 +156,17 @@ class HeuristicProcessor(object):
] ]
ITALICIZE_STYLE_PATS = [ ITALICIZE_STYLE_PATS = [
r'(?msu)(?<=[\s>])_(?P<words>[^_]+)_', ur'(?msu)(?<=[\s>"\'])_(?P<words>[^_]+)_',
r'(?msu)(?<=[\s>])/(?P<words>[^/\*>]+)/', ur'(?msu)(?<=[\s>"\'])/(?P<words>[^/\*>]+)/',
r'(?msu)(?<=[\s>])~~(?P<words>[^~]+)~~', ur'(?msu)(?<=[\s>"\'])~~(?P<words>[^~]+)~~',
r'(?msu)(?<=[\s>])\*(?P<words>[^\*]+)\*', ur'(?msu)(?<=[\s>"\'])\*(?P<words>[^\*]+)\*',
r'(?msu)(?<=[\s>])~(?P<words>[^~]+)~', ur'(?msu)(?<=[\s>"\'])~(?P<words>[^~]+)~',
r'(?msu)(?<=[\s>])_/(?P<words>[^/_]+)/_', ur'(?msu)(?<=[\s>"\'])_/(?P<words>[^/_]+)/_',
r'(?msu)(?<=[\s>])_\*(?P<words>[^\*_]+)\*_', ur'(?msu)(?<=[\s>"\'])_\*(?P<words>[^\*_]+)\*_',
r'(?msu)(?<=[\s>])\*/(?P<words>[^/\*]+)/\*', ur'(?msu)(?<=[\s>"\'])\*/(?P<words>[^/\*]+)/\*',
r'(?msu)(?<=[\s>])_\*/(?P<words>[^\*_]+)/\*_', ur'(?msu)(?<=[\s>"\'])_\*/(?P<words>[^\*_]+)/\*_',
r'(?msu)(?<=[\s>])/:(?P<words>[^:/]+):/', ur'(?msu)(?<=[\s>"\'])/:(?P<words>[^:/]+):/',
r'(?msu)(?<=[\s>])\|:(?P<words>[^:\|]+):\|', ur'(?msu)(?<=[\s>"\'])\|:(?P<words>[^:\|]+):\|',
] ]
for word in ITALICIZE_WORDS: for word in ITALICIZE_WORDS:

View File

@ -112,7 +112,7 @@ class ThreadedJob(BaseJob):
self.start_time = time.time() self.start_time = time.time()
self.duration = 0.0001 self.duration = 0.0001
else: else:
self.duration = time.time() - self.start_time() self.duration = time.time() - self.start_time
self.abort.set() self.abort.set()
self.log('Aborted job:', self.description) self.log('Aborted job:', self.description)