This commit is contained in:
Kovid Goyal 2008-10-30 19:18:37 -07:00
parent 0f6cbc5109
commit 102aa48708
3 changed files with 10 additions and 3 deletions

View File

@ -573,7 +573,10 @@ class Processor(Parser):
style.tail = '\n' style.tail = '\n'
path = os.path.join(os.path.dirname(self.save_path()), *(style.get('href').split('/'))) path = os.path.join(os.path.dirname(self.save_path()), *(style.get('href').split('/')))
self.resource_map[path] = style.get('href') self.resource_map[path] = style.get('href')
open(path, 'wb').write(getattr(sheet, 'cssText', sheet).encode('utf-8')) raw = getattr(sheet, 'cssText', sheet)
if isinstance(raw, unicode):
raw = raw.encode('utf-8')
open(path, 'wb').write(raw)
return Parser.save(self) return Parser.save(self)
def populate_toc(self, toc): def populate_toc(self, toc):

View File

@ -72,6 +72,8 @@ class DBTest(unittest.TestCase):
self.assertEqual(getattr(self.db, x)(2), val) self.assertEqual(getattr(self.db, x)(2), val)
self.db.set_authors(3, ['new auth']) self.db.set_authors(3, ['new auth'])
self.db.refresh_ids([3])
self.assertEqual('new auth', self.db.authors(2))
self.assertEqual(self.db.format(3, 'txt', index_is_id=True), 'test') self.assertEqual(self.db.format(3, 'txt', index_is_id=True), 'test')

View File

@ -541,8 +541,10 @@ class BasicNewsRecipe(object, LoggingInterface):
npos = max(si, gi) npos = max(si, gi)
if npos < 0: if npos < 0:
npos = pos npos = pos
ans = src[:npos+1]
return src[:npos+1]+u'\u2026' if isinstance(ans, unicode):
return
return ans+u'\u2026' if isinstance(ans, unicode) else ans + '...'