diff --git a/src/calibre/devices/cybookg3/t2b.py b/src/calibre/devices/cybookg3/t2b.py index 0baa7a1060..5bf512f22d 100644 --- a/src/calibre/devices/cybookg3/t2b.py +++ b/src/calibre/devices/cybookg3/t2b.py @@ -4,7 +4,8 @@ __copyright__ = '2009, John Schember ' Write a t2b file to disk. ''' -import Image, StringIO +import StringIO +from PIL import Image DEFAULT_T2B_DATA = '\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x0f\xff\xff\xff\xf0\xff\x0f\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x00\xff\xff\xff\xf0\xff\x0f\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe0\xff\xf0\xff\xff\xff\xf0\xff\xff\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\xff\xff\xff\xff\xff\xf0\xff\xff\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x07\xff\xff\xfc\x00?\xf0\xff\x0f\xc3\x00?\xf0\xc0\xfe\x00?\xff\xff\xff\xff\xff\xff\xff\x0f\xff\xff\xf0<\x0f\xf0\xff\x0f\xc0,\x0f\xf0\x0e\xf0,\x0f\xff\xff\xff\xff\xff\xff\xff\x0f\xff\xff\xff\xff\xc3\xf0\xff\x0f\xc0\xff\x0f\xf0\xff\xf0\xff\xc7\xff\xff\xff\xff\xff\xff\xff\x0f\xff\xff\xff\xff\xc3\xf0\xff\x0f\xc3\xff\xc3\xf0\xff\xc3\xff\xc3\xff\xff\xff\xff\xff\xff\xff\x0f\xff\xff\xff\x00\x03\xf0\xff\x0f\xc3\xff\xc3\xf0\xff\xc3\xff\xc3\xff\xff\xff\xff\xff\xff\xff\x0f\xff\xff\xf0\x1f\xc3\xf0\xff\x0f\xc3\xff\xc3\xf0\xff\xc0\x00\x03\xff\xff\xff\xff\xff\xff\xff\x0b\xff\xff\xf0\xff\xc3\xf0\xff\x0f\xc3\xff\xc3\xf0\xff\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc3\xff\xff\xf3\xff\xc3\xf0\xff\x0f\xc3\xff\xc3\xf0\xff\xc3\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\xff\xfc\xf0\xff\x03\xf0\xff\x0f\xc0\xff\x0f\xf0\xff\xf0\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x0f\x00\xf08\x03\xf0\xff\x0f\xc0,\x0f\xf0\xff\xf0\x1f\x03\xff\xff\xff\xff\xff\xff\xff\xff\x00\x0f\xfc\x00\xc3\xf0\xff\x0f\xc3\x00?\xf0\xff\xff\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x03\xfe\x94\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xfc\x7f\xfe\x94\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x0f\xff\xfe\xa9@\xff\xff\xff\xff\xff\xff\xfc?\xfe\xa4\xff\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xe9P\xff\xff\xff\xff\xff\xff\xfe/\xfe\xa8\xff\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xf9T\xff\xff\xff\xff\xf0@\x00+\xfa\xa8?\xff\xff\xff\xff\xff\xff\xff\xfc\xbf\xff\xff\xf9T\xff\xff\xff\xff\xcb\xe4}*\xaa\xaa?\xff\xff\xff\xff\xff\xff\xff\xfc\xbf\xff\xff\xe9T\xff\xff\xff\xff\xc7\xe4\xfd\x1a\xaa\xaa?\xff\xff\xff\xff\xff\xff\xff\xfc\xaf\xea\xaa\xa6\xa4\xff@\x00\x0f\xc3\xe8\xfe\x1a\xaa\xaa?\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4\x00\x7f\xfe\x90\x03\xe8\xfe\n\xaa\xaa?\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4?\xff\xff\xa5C\xe8\xfe\x06\xaa\xaa?\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4?\xff\xff\xeaC\xe8\xbe\x06\xaa\xaa\x0f\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4/\xff\xff\xea\x82\xe8j\x06\xaa\xaa\x0f\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4/\xff\xff\xaa\x82\xe8*F\xaa\xaa\x8f\xff\xff\xff\xff\xff\xff\xff\xfcj\x95UZ\xa4+\xff\xfe\xaa\x82\xe8*\x86\xaa\xaa\x8f\xff\xff\x80\xff\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8*\x86\xaa\xaa\x8f\xf0\x00T?\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8*\x81\xaa\xaa\x8c\x03\xff\x95?\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8*\x81\xaa\xaa\x80\xbf\xff\x95?\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8*\x81\xaa\xaa\x9b\xff\xff\x95\x0f\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8\x1a\x81\xaa\xaa\x9a\xff\xfe\x95\x0f\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xe8\n\x81\xaa\xaa\xa6\xbf\xfeUO\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xa8\n\x91j\xaa\xa5\xaa\xa9ZO\xff\xff\xff\xfcj\x95UV\xa4\x1a\xfa\xaa\xaa\x82\xa8\n\xa0j\xaa\xa5Z\x95ZO\xff\xff\xff\xfcj\x95UV\xa4*\xfa\xaa\xaa\x82\xa9\n\xa0j\xaa\xa5UUZC\xff\xff\xff\xfcj\x95UV\xa4*\xfa\xaa\xaa\x82\xaa\n\xa0j\xaa\xa4UUZS\xff\xff\xff\xfcZ\x95UV\xa4*\xfa\xaa\xaa\x82\xaa\n\xa0j\xaa\xa4UUZS\xff\xff\xff\xfcZ\x95UU\xa4*\xfa\xaa\xaa\x82\xaa\n\xa0j\xaa\xa8UUVS\xff\xff\xff\xfcZ\x95UU\xa4*\xea\xaa\xaa\x82\xaa\x06\xa0Z\xaa\xa8UUV\x93\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x81\xaa\x02\xa0\x1a\xaa\xa8UUV\x90\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x80\xaa\x02\xa0\x1a\xaa\xa8\x15UU\x94\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x80\xaa"\xa0\x1a\xaa\xa8\x15UU\x94\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x80\xaa2\xa4\x16\xaa\xa8\x15UU\x94\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x80\xaa2\xa8\x16\xa6\xa9\x15UU\x94\xff\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x80\xaa2\xa8\x16\xa6\xa9\x05UUT?\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x84\xaa2\xa8\x16\xaa\xaa\x05UUU?\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x88\xaa2\xa8\x06\xaa\xaa\x05UUU?\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa1\xa8\xc5\xaa\xaa\x05UUU?\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa0\xa8E\xa9\xaa\x05UUU/\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa<\xa8\x05\xa9\xaaAUUU\x0f\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa<\xa8\x05\xa9\xaaAUUUO\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa<\xa9\x05\xaa\xaaAUUUO\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x1c\xaa\x01\xaa\xaa\x81UUUO\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x0c\xaa\x01\xaa\xaa\x81UUUO\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x0c\xaa1j\xaa\x80UUUC\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x0cj1jj\x90UUUS\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x0c*1jj\x90UUUS\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaaL*1jj\xa0UUUS\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x8f* j\xaa\xa0\x15UUS\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x8f*@j\xaa\xa0\x15UUP\xff\xff\xfcZ\x95UU\xa4*\xaa\xaa\xaa\x8c\xaa\x8f*\x8cZ\xaa\xa1\x15UUT\xff\xff\xfcZ\x95UU\xa4j\xaa\xaa\xaa\x8c\xaa\x8f*\x8cZ\x9a\xa0\x15UUT\xff\xff\xfcZ\x95UU\xa4j\xaa\xaa\xaa\x8c\xaa\x8f*\x8cZ\x9a\xa0\x15UUT\xff\xff\xfcZ\x95UU\xa4j\xaa\xaa\xaa\x8c\xaa\x8f\x1a\x8cZ\x9a\xa4\x15UUT?\xff\xfcZ\x95UU\x94j\xaa\xaa\xaa\x8cj\x8f\n\x8cVj\xa4\x05UU\xa4?\xff\xfcVUUU\xa4j\xaa\xaa\xaa\x8cj\x8fJ\x8c\x16\xaa\xa8\xc5UZ\xa5?\xff\xfcUUUV\xa4j\xaa\xaa\xaa\x8cj\x8f\xca\x8f\x16\xaa\xa8\xc5V\xaa\xa5?\xff\xfcUj\xaa\xaa\xa4j\xaa\xaa\xaa\x8cj\x8f\xca\x8f\x1a\xaa\xa8\x05Z\xaaU?\xff\xfcV\xaa\xaa\xaa\xa5j\xaa\xaa\xaa\x8e*\x8f\xca\x83\x1a\xaa\xa4\x01eUU?\xff\xfcZ\xaa\xaa\xaa\xa5j\xaa\xaa\xaa\x8f*\x8f\xca\x83\x1a\xa5U\x01U\x00\x00\x0f\xff\xfcUUUUUZ\xaa\xaa\xaaO%\x8f\xc6\x93\x15\x00\x001@\x0f\xff\xff\xff\xfcP\x00\x00\x00\x15\x00\x00\x00\x00\x0f\x00\x07\xc0\x03\x00\xff\xff0\x1f\xff\xff\xff\xff\xfc\x00\xff\xff\xf8\x00?\xff\xff\xff\x0f?\xc7\xc3\xf7\x0f\xff\xff\xf1\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xf4\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' diff --git a/src/calibre/devices/usbms/device.py b/src/calibre/devices/usbms/device.py index c1dd56385a..ef2800b1cc 100644 --- a/src/calibre/devices/usbms/device.py +++ b/src/calibre/devices/usbms/device.py @@ -177,9 +177,9 @@ class Device(_Device): wmi = __import__('wmi', globals(), locals(), [], -1) c = wmi.WMI() for drive in c.Win32_DiskDrive(): - if self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_MAIN_MEM): + if self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_MAIN_MEM): drives['main'] = self.windows_get_drive_prefix(drive) - elif self.windows_match_device(str(drive.PNPDeviceID), WINDOWS_CARD_MEM): + elif self.windows_match_device(str(drive.PNPDeviceID), self.WINDOWS_CARD_MEM): drives['card'] = self.windows_get_drive_prefix(drive) if 'main' and 'card' in drives.keys(): diff --git a/src/calibre/ebooks/epub/__init__.py b/src/calibre/ebooks/epub/__init__.py index d8d4c9a758..4e305b000b 100644 --- a/src/calibre/ebooks/epub/__init__.py +++ b/src/calibre/ebooks/epub/__init__.py @@ -15,15 +15,17 @@ from lxml import etree class DefaultProfile(object): - flow_size = sys.maxint - screen_size = None + flow_size = sys.maxint + screen_size = None remove_special_chars = False + remove_object_tags = False class PRS505(DefaultProfile): - flow_size = 270000 - screen_size = (590, 765) + flow_size = 270000 + screen_size = (590, 765) remove_special_chars = re.compile(u'[\u200b\u00ad]') + remove_object_tags = True PROFILES = { @@ -156,7 +158,7 @@ to auto-generate a Table of Contents. help=_('Set the right margin in pts. Default is %default')) layout('base_font_size2', ['--base-font-size'], default=12.0, help=_('The base font size in pts. Default is %defaultpt. Set to 0 to disable rescaling of fonts.')) - layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=True, + layout('remove_paragraph_spacing', ['--remove-paragraph-spacing'], default=False, help=_('Remove spacing between paragraphs. Will not work if the source file forces inter-paragraph spacing.')) layout('preserve_tag_structure', ['--preserve-tag-structure'], default=False, help=_('Preserve the HTML tag structure while splitting large HTML files. This is only neccessary if the HTML files contain CSS that uses sibling selectors. Enabling this greatly slows down processing of large HTML files.')) diff --git a/src/calibre/ebooks/epub/from_feeds.py b/src/calibre/ebooks/epub/from_feeds.py index fd1759712d..6a12353f50 100644 --- a/src/calibre/ebooks/epub/from_feeds.py +++ b/src/calibre/ebooks/epub/from_feeds.py @@ -52,6 +52,7 @@ def convert(opts, recipe_arg, notification=None): print 'Generating epub...' opts.encoding = 'utf-8' + opts.remove_paragraph_spacing = True html2epub(opf, opts, notification=notification) diff --git a/src/calibre/ebooks/epub/from_html.py b/src/calibre/ebooks/epub/from_html.py index 179c0af22b..664ac21de9 100644 --- a/src/calibre/ebooks/epub/from_html.py +++ b/src/calibre/ebooks/epub/from_html.py @@ -158,6 +158,10 @@ class HTMLProcessor(Processor, Rationalizer): for br in self.body.xpath('./br'): br.tag = 'p' br.text = u'\u00a0' + + if self.opts.profile.remove_object_tags: + for tag in self.root.xpath('//object|//embed'): + tag.getparent().remove(tag) def save(self): for meta in list(self.root.xpath('//meta')): diff --git a/src/calibre/ebooks/epub/iterator.py b/src/calibre/ebooks/epub/iterator.py index 08c275e81f..5601e9b8de 100644 --- a/src/calibre/ebooks/epub/iterator.py +++ b/src/calibre/ebooks/epub/iterator.py @@ -95,7 +95,7 @@ class EbookIterator(object): for match in re.compile(r'@font-face\s*{([^}]+)}').finditer(css): block = match.group(1) family = re.compile(r'font-family\s*:\s*([^;]+)').search(block) - url = re.compile(r'url\s*\((.+?)\)', re.DOTALL).search(block) + url = re.compile(r'url\s*\([\'"]*(.+?)[\'"]*\)', re.DOTALL).search(block) if url: path = url.group(1).split('/') path = os.path.join(os.path.dirname(item.path), *path) diff --git a/src/calibre/ebooks/html.py b/src/calibre/ebooks/html.py index 634963e775..c853f62171 100644 --- a/src/calibre/ebooks/html.py +++ b/src/calibre/ebooks/html.py @@ -848,7 +848,7 @@ class Processor(Parser): # Workaround for anchor rendering bug in ADE css += '\n\na { color: inherit; text-decoration: inherit; cursor: default; }\na[href] { color: blue; text-decoration: underline; cursor:pointer; }' if self.opts.remove_paragraph_spacing: - css += '\n\np {text-indent: 2em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}' + css += '\n\np {text-indent: 1.5em; margin-top:0pt; margin-bottom:0pt; padding:0pt; border:0pt;}' if self.opts.override_css: css += '\n\n' + self.opts.override_css self.override_css = self.css_parser.parseString(self.preprocess_css(css)) diff --git a/src/calibre/ebooks/mobi/mobiml.py b/src/calibre/ebooks/mobi/mobiml.py index 7a74bd9401..afc2fb63ba 100644 --- a/src/calibre/ebooks/mobi/mobiml.py +++ b/src/calibre/ebooks/mobi/mobiml.py @@ -12,7 +12,7 @@ import copy import re from lxml import etree from calibre.ebooks.oeb.base import namespace, barename -from calibre.ebooks.oeb.base import XHTML, XHTML_NS +from calibre.ebooks.oeb.base import XHTML, XHTML_NS, OEB_DOCS from calibre.ebooks.oeb.stylizer import Stylizer from calibre.ebooks.oeb.transforms.flatcss import KeyMapper @@ -96,8 +96,11 @@ class MobiMLizer(object): href = oeb.guide['cover'].href del oeb.guide['cover'] item = oeb.manifest.hrefs[href] - oeb.manifest.remove(item) - + if item.spine_position is not None: + oeb.spine.remove(item) + if item.media_type in OEB_DOCS: + self.oeb.manifest.remove(item) + def mobimlize_spine(self): for item in self.oeb.spine: stylizer = Stylizer(item.data, item.href, self.oeb, self.profile) @@ -137,7 +140,7 @@ class MobiMLizer(object): para = bstate.para if tag in SPECIAL_TAGS and not text: para = para if para is not None else bstate.body - elif para is None: + elif para is None or tag in ('td', 'th'): body = bstate.body if bstate.pbreak: etree.SubElement(body, MBP('pagebreak')) @@ -157,7 +160,8 @@ class MobiMLizer(object): elif indent != 0 and abs(indent) < self.profile.fbase: indent = (indent / abs(indent)) * self.profile.fbase if tag in NESTABLE_TAGS: - para = wrapper = etree.SubElement(parent, XHTML(tag)) + para = wrapper = etree.SubElement( + parent, XHTML(tag), attrib=istate.attrib) bstate.nested.append(para) if tag == 'li' and len(istates) > 1: istates[-2].list_num += 1 @@ -337,6 +341,10 @@ class MobiMLizer(object): tag = 'tr' elif display == 'table-cell': tag = 'td' + if tag in TABLE_TAGS: + for attr in ('rowspan', 'colspan'): + if attr in elem.attrib: + istate.attrib[attr] = elem.attrib[attr] text = None if elem.text: if istate.preserve: @@ -374,6 +382,6 @@ class MobiMLizer(object): bstate.vpadding += bstate.vmargin bstate.vmargin = 0 bstate.vpadding += vpadding - if tag in NESTABLE_TAGS and bstate.nested: + if bstate.nested and bstate.nested[-1].tag == elem.tag: bstate.nested.pop() istates.pop() diff --git a/src/calibre/ebooks/mobi/reader.py b/src/calibre/ebooks/mobi/reader.py index 2ed41ac898..5d2edd3fe0 100644 --- a/src/calibre/ebooks/mobi/reader.py +++ b/src/calibre/ebooks/mobi/reader.py @@ -124,6 +124,7 @@ class BookHeader(object): sublangid = (langcode >> 10) & 0xFF self.language = main_language.get(langid, 'ENGLISH') self.sublanguage = sub_language.get(sublangid, 'NEUTRAL') + self.first_image_index = struct.unpack('>L', raw[0x6c:0x6c+4])[0] self.exth_flag, = struct.unpack('>L', raw[0x80:0x84]) self.exth = None @@ -441,17 +442,18 @@ class MobiReader(object): os.makedirs(output_dir) image_index = 0 self.image_names = [] - for i in range(self.num_sections): + for i in range(self.book_header.first_image_index, self.num_sections): if i in processed_records: continue processed_records.append(i) data = self.sections[i][0] buf = cStringIO.StringIO(data) + image_index += 1 try: im = PILImage.open(buf) - except IOError: + except IOError, e: continue - image_index += 1 + path = os.path.join(output_dir, '%05d.jpg'%image_index) self.image_names.append(os.path.basename(path)) im.convert('RGB').save(open(path, 'wb'), format='JPEG') @@ -476,6 +478,7 @@ def get_metadata(stream): else: tdir = tempfile.mkdtemp('_mobi_meta', __appname__+'_') atexit.register(shutil.rmtree, tdir) + #print tdir mr.extract_images([], tdir) mi = mr.create_opf('dummy.html') if mi.cover: @@ -491,7 +494,6 @@ def get_metadata(stream): if os.access(candidate, os.R_OK): cover = candidate break - if os.access(cover, os.R_OK): mi.cover_data = ('JPEG', open(os.path.join(tdir, cover), 'rb').read()) else: diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 62d444ee95..3be283fa0a 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -95,6 +95,7 @@ class Serializer(object): def __init__(self, oeb, images): self.oeb = oeb self.images = images + self.logger = oeb.logger self.id_offsets = {} self.href_offsets = defaultdict(list) self.breaks = [] @@ -144,8 +145,8 @@ class Serializer(object): item = hrefs[path] if path else None if item and item.spine_position is None: return False - id = item.id if item else base.id - href = '#'.join((id, frag)) if frag else id + path = item.href if item else base.href + href = '#'.join((path, frag)) if frag else path buffer.write('filepos=') self.href_offsets[href].append(buffer.tell()) buffer.write('0000000000') @@ -170,7 +171,7 @@ class Serializer(object): buffer = self.buffer if not item.linear: self.breaks.append(buffer.tell() - 1) - self.id_offsets[item.id] = buffer.tell() + self.id_offsets[item.href] = buffer.tell() for elem in item.data.find(XHTML('body')): self.serialize_elem(elem, item) buffer.write('') @@ -180,12 +181,11 @@ class Serializer(object): if not isinstance(elem.tag, basestring) \ or namespace(elem.tag) not in nsrmap: return - hrefs = self.oeb.manifest.hrefs tag = prefixname(elem.tag, nsrmap) for attr in ('name', 'id'): if attr in elem.attrib: - id = '#'.join((item.id, elem.attrib[attr])) - self.id_offsets[id] = buffer.tell() + href = '#'.join((item.href, elem.attrib[attr])) + self.id_offsets[href] = buffer.tell() del elem.attrib[attr] if tag == 'a' and not elem.attrib \ and not len(elem) and not elem.text: @@ -203,7 +203,7 @@ class Serializer(object): continue elif attr == 'src': href = item.abshref(val) - if href in hrefs: + if href in self.images: index = self.images[href] buffer.write('recindex="%05d"' % index) continue @@ -233,8 +233,12 @@ class Serializer(object): def fixup_links(self): buffer = self.buffer - for id, hoffs in self.href_offsets.items(): - ioff = self.id_offsets[id] + id_offsets = self.id_offsets + for href, hoffs in self.href_offsets.items(): + if href not in id_offsets: + self.logger.warn('Hyperlink target %r not found' % href) + href, _ = urldefrag(href) + ioff = self.id_offsets[href] for hoff in hoffs: buffer.seek(hoff) buffer.write('%010d' % ioff) @@ -360,7 +364,11 @@ class MobiWriter(object): if image.format not in ('JPEG', 'GIF'): width, height = image.size area = width * height - format = 'GIF' if area <= 40000 else 'JPEG' + if area <= 40000: + format = 'GIF' + else: + image = image.convert('RGBA') + format = 'JPEG' changed = True if dimen is not None: image.thumbnail(dimen, Image.ANTIALIAS) @@ -507,6 +515,9 @@ def add_mobi_options(parser): group.add_option( '-r', '--rescale-images', default=False, action='store_true', help=_('Modify images to meet Palm device size limitations.')) + group.add_option( + '--toc-title', default=None, action='store', + help=_('Title for any generated in-line table of contents.')) parser.add_option_group(group) group = OptionGroup(parser, _('Profiles'), _('Device renderer profiles. ' 'Affects conversion of default font sizes and rasterization ' @@ -550,7 +561,7 @@ def oeb2mobi(opts, inpath): imagemax = PALM_MAX_IMAGE_SIZE if opts.rescale_images else None context = Context(source, dest) oeb = OEBBook(inpath, logger=logger) - tocadder = HTMLTOCAdder() + tocadder = HTMLTOCAdder(title=opts.toc_title) tocadder.transform(oeb, context) mangler = CaseMangler() mangler.transform(oeb, context) diff --git a/src/calibre/ebooks/oeb/base.py b/src/calibre/ebooks/oeb/base.py index 4248657e23..c167151a5f 100644 --- a/src/calibre/ebooks/oeb/base.py +++ b/src/calibre/ebooks/oeb/base.py @@ -15,11 +15,12 @@ from urlparse import urldefrag, urlparse, urlunparse from urllib import unquote as urlunquote import logging import re -import htmlentitydefs import uuid import copy from lxml import etree +from lxml import html from calibre import LoggingInterface +from calibre.translations.dynamic import translate XML_PARSER = etree.XMLParser(recover=True) XML_NS = 'http://www.w3.org/XML/1998/namespace' @@ -67,14 +68,6 @@ OEB_IMAGES = set([GIF_MIME, JPEG_MIME, PNG_MIME, SVG_MIME]) MS_COVER_TYPE = 'other.ms-coverimage-standard' -recode = lambda s: s.decode('iso-8859-1').encode('ascii', 'xmlcharrefreplace') -ENTITYDEFS = dict((k, recode(v)) for k, v in htmlentitydefs.entitydefs.items()) -del ENTITYDEFS['lt'] -del ENTITYDEFS['gt'] -del ENTITYDEFS['quot'] -del ENTITYDEFS['amp'] -del recode - def element(parent, *args, **kwargs): if parent is not None: @@ -298,7 +291,6 @@ class Metadata(object): class Manifest(object): class Item(object): - ENTITY_RE = re.compile(r'&([a-zA-Z_:][a-zA-Z0-9.-_:]+);') NUM_RE = re.compile('^(.*)([0-9][0-9.]*)(?=[.]|$)') def __init__(self, id, href, media_type, @@ -317,9 +309,12 @@ class Manifest(object): % (self.id, self.href, self.media_type) def _force_xhtml(self, data): - repl = lambda m: ENTITYDEFS.get(m.group(1), m.group(0)) - data = self.ENTITY_RE.sub(repl, data) - data = etree.fromstring(data, parser=XML_PARSER) + try: + data = etree.fromstring(data, parser=XML_PARSER) + except etree.XMLSyntaxError: + data = html.fromstring(data, parser=XML_PARSER) + data = etree.tostring(data, encoding=unicode) + data = etree.fromstring(data, parser=XML_PARSER) if namespace(data.tag) != XHTML_NS: data.attrib['xmlns'] = XHTML_NS data = etree.tostring(data) @@ -506,6 +501,7 @@ class Spine(object): self.items.pop(index) for i in xrange(index, len(self.items)): self.items[i].spine_position = i + item.spine_position = None def __iter__(self): for item in self.items: @@ -680,22 +676,22 @@ class TOC(object): node.to_opf1(tour) return tour - def to_ncx(self, parent, playorder=None, depth=1): - if not playorder: playorder = [0] + def to_ncx(self, parent, order=None, depth=1): + if not order: order = [0] for node in self.nodes: - playorder[0] += 1 + order[0] += 1 + playOrder = str(order[0]) + id = self.id or 'np' + playOrder point = etree.SubElement(parent, - NCX('navPoint'), attrib={'playOrder': str(playorder[0])}) + NCX('navPoint'), id=id, playOrder=playOrder) if self.klass: point.attrib['class'] = node.klass - if self.id: - point.attrib['id'] = node.id label = etree.SubElement(point, NCX('navLabel')) etree.SubElement(label, NCX('text')).text = node.title href = node.href if depth > 1 else urldefrag(node.href)[0] child = etree.SubElement(point, NCX('content'), attrib={'src': href}) - node.to_ncx(point, playorder, depth+1) + node.to_ncx(point, order, depth+1) return parent @@ -802,12 +798,20 @@ class OEBBook(object): def _manifest_from_opf(self, opf): self.manifest = manifest = Manifest(self) for elem in xpath(opf, '/o2:package/o2:manifest/o2:item'): + id = elem.get('id') href = elem.get('href') + media_type = elem.get('media-type') + fallback = elem.get('fallback') + if href in manifest.hrefs: + self.logger.warn(u'Duplicate manifest entry for %r.' % href) + continue if not self.container.exists(href): self.logger.warn(u'Manifest item %r not found.' % href) continue - manifest.add(elem.get('id'), href, elem.get('media-type'), - elem.get('fallback')) + if id in manifest.ids: + self.logger.warn(u'Duplicate manifest id %r.' % id) + id, href = manifest.generate(id, href) + manifest.add(id, href, media_type, fallback) def _spine_from_opf(self, opf): self.spine = spine = Spine(self) @@ -970,6 +974,11 @@ class OEBBook(object): self._toc_from_opf(opf) self._ensure_cover_image() + def translate(self, text): + lang = str(self.metadata.language[0]) + lang = lang.split('-', 1)[0].lower() + return translate(lang, text) + def to_opf1(self): package = etree.Element('package', attrib={'unique-identifier': self.uid.id}) @@ -983,22 +992,11 @@ class OEBBook(object): guide = self.guide.to_opf1(package) return {OPF_MIME: ('content.opf', package)} - def _generate_ncx_item(self): - id = 'ncx' - index = 0 - while id in self.manifest: - id = 'ncx' + str(index) - index = index + 1 - href = 'toc' - index = 0 - while (href + '.ncx') in self.manifest.hrefs: - href = 'toc' + str(index) - href += '.ncx' - return (id, href) - def _to_ncx(self): - ncx = etree.Element(NCX('ncx'), attrib={'version': '2005-1'}, - nsmap={None: NCX_NS}) + lang = unicode(self.metadata.language[0]) + ncx = etree.Element(NCX('ncx'), + attrib={'version': '2005-1', XML('lang'): lang}, + nsmap={None: NCX_NS}) head = etree.SubElement(ncx, NCX('head')) etree.SubElement(head, NCX('meta'), attrib={'name': 'dtb:uid', 'content': unicode(self.uid)}) @@ -1021,7 +1019,7 @@ class OEBBook(object): nsmap={None: OPF2_NS}) metadata = self.metadata.to_opf2(package) manifest = self.manifest.to_opf2(package) - id, href = self._generate_ncx_item() + id, href = self.manifest.generate('ncx', 'toc.ncx') etree.SubElement(manifest, OPF('item'), attrib={'id': id, 'href': href, 'media-type': NCX_MIME}) spine = self.spine.to_opf2(package) diff --git a/src/calibre/ebooks/oeb/transforms/htmltoc.py b/src/calibre/ebooks/oeb/transforms/htmltoc.py index 9eaa04d41d..7da7df17e9 100644 --- a/src/calibre/ebooks/oeb/transforms/htmltoc.py +++ b/src/calibre/ebooks/oeb/transforms/htmltoc.py @@ -44,13 +44,15 @@ body > .calibre_toc_block { } class HTMLTOCAdder(object): - def __init__(self, style='nested'): + def __init__(self, title=None, style='nested'): + self.title = title self.style = style def transform(self, oeb, context): if 'toc' in oeb.guide: return oeb.logger.info('Generating in-line TOC...') + title = self.title or oeb.translate('Table of Contents') style = self.style if style not in STYLE_CSS: oeb.logger.error('Unknown TOC style %r' % style) @@ -61,15 +63,15 @@ class HTMLTOCAdder(object): contents = element(None, XHTML('html'), nsmap={None: XHTML_NS}, attrib={XML('lang'): language}) head = element(contents, XHTML('head')) - title = element(head, XHTML('title')) - title.text = 'Table of Contents' + htitle = element(head, XHTML('title')) + htitle.text = title element(head, XHTML('link'), rel='stylesheet', type=CSS_MIME, href=css_href) body = element(contents, XHTML('body'), attrib={'class': 'calibre_toc'}) h1 = element(body, XHTML('h1'), attrib={'class': 'calibre_toc_header'}) - h1.text = 'Table of Contents' + h1.text = title self.add_toc_level(body, oeb.toc) id, href = oeb.manifest.generate('contents', 'contents.xhtml') item = oeb.manifest.add(id, href, XHTML_MIME, data=contents) diff --git a/src/calibre/ebooks/oeb/transforms/trimmanifest.py b/src/calibre/ebooks/oeb/transforms/trimmanifest.py index bd2c388245..b150a12831 100644 --- a/src/calibre/ebooks/oeb/transforms/trimmanifest.py +++ b/src/calibre/ebooks/oeb/transforms/trimmanifest.py @@ -41,8 +41,9 @@ class ManifestTrimmer(object): while unchecked: new = set() for item in unchecked: - if item.media_type in OEB_DOCS or \ - item.media_type[-4:] in ('/xml', '+xml'): + if (item.media_type in OEB_DOCS or + item.media_type[-4:] in ('/xml', '+xml')) and \ + item.data is not None: hrefs = [sel(item.data) for sel in LINK_SELECTORS] for href in chain(*hrefs): href = item.abshref(href) diff --git a/src/calibre/gui2/main.py b/src/calibre/gui2/main.py index 5753a7c974..b2d06a0502 100644 --- a/src/calibre/gui2/main.py +++ b/src/calibre/gui2/main.py @@ -296,6 +296,8 @@ class Main(MainWindow, Ui_MainWindow): self.card_view.connect_dirtied_signal(self.upload_booklists) self.show() + if self.system_tray_icon.isVisible() and opts.start_in_tray: + self.hide() self.stack.setCurrentIndex(0) try: db = LibraryDatabase2(self.library_path) @@ -1527,6 +1529,8 @@ path_to_ebook to the database. ''') parser.add_option('--with-library', default=None, action='store', help=_('Use the library located at the specified path.')) + parser.add_option('--start-in-tray', default=False, action='store_true', + help=_('Start minimized to system tray.')) parser.add_option('-v', '--verbose', default=0, action='count', help=_('Log debugging information to console')) return parser diff --git a/src/calibre/translations/bg.po b/src/calibre/translations/bg.po index e43eac8cd8..fda52bd450 100644 --- a/src/calibre/translations/bg.po +++ b/src/calibre/translations/bg.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" diff --git a/src/calibre/translations/ca.po b/src/calibre/translations/ca.po index 68e647af03..3252a734d1 100644 --- a/src/calibre/translations/ca.po +++ b/src/calibre/translations/ca.po @@ -17,7 +17,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/cs.po b/src/calibre/translations/cs.po index c8c034836d..ff3de5f3cb 100644 --- a/src/calibre/translations/cs.po +++ b/src/calibre/translations/cs.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/de.po b/src/calibre/translations/de.po index 3377eb25b7..7883a39db7 100644 --- a/src/calibre/translations/de.po +++ b/src/calibre/translations/de.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-01-19 04:38+0000\n" -"PO-Revision-Date: 2009-01-10 09:57+0000\n" +"PO-Revision-Date: 2009-01-19 21:16+0000\n" "Last-Translator: S. Dorscht \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" @@ -1836,7 +1836,7 @@ msgstr "Benutzung: rb-meta file.rb" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 msgid "Creating Mobipocket file from EPUB..." -msgstr "" +msgstr "Erstelle Mobipocket Datei aus EPUB..." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 msgid "%prog [options] myebook.mobi" @@ -1848,47 +1848,51 @@ msgstr "Original MOBI HTML gespeichert in" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 msgid "Mobipocket" -msgstr "" +msgstr "Mobipocket" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 msgid "Mobipocket-specific options." -msgstr "" +msgstr "Einstellungen speziell für Mobipocket." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 msgid "" "Compress file text using PalmDOC compression. Results in smaller files, but " "takes a long time to run." msgstr "" +"Textdatei mit PalmDOC compression komprimieren. Ergibt kleinere Dateien, " +"dauert aber länger beim Start." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 msgid "Modify images to meet Palm device size limitations." -msgstr "" +msgstr "Bilder auf die Größenlimitation von Palm Geräten einstellen." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "" "Device renderer profiles. Affects conversion of default font sizes and " "rasterization resolution. Valid profiles are: %s." msgstr "" +"Profile der Gerätedarstellung. Betrifft das Konvertieren mit " +"voreingestellten Schriftgrößen und Rasterauflösung. Vorhandene Profile: %s." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "Profiles" -msgstr "" +msgstr "Profile" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 msgid "Source renderer profile. Default is 'Browser'." -msgstr "" +msgstr "Profil der Quellendarstellung. Voreinstellung ist 'Browser'." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519 msgid "Destination renderer profile. Default is 'CybookG3'." -msgstr "" +msgstr "Profil der Zieldarstellung. Voreinstellung ist 'CybookG3'." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543 msgid "Unknown source profile %r" -msgstr "" +msgstr "Unbekanntes Profil der Quelle %r" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547 msgid "Unknown destination profile %r" -msgstr "" +msgstr "Unbekanntes Profil des Ziels %r" #: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57 msgid "The output directory. Defaults to the current directory." @@ -3513,7 +3517,7 @@ msgstr "Passwort erforderlich" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 msgid "Aborting..." -msgstr "" +msgstr "Abbruch läuft ..." #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 msgid "You" @@ -4548,11 +4552,11 @@ msgstr "Speichern auf Festplatte nicht möglich" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 msgid "Saving to disk..." -msgstr "" +msgstr "Speichere auf Festplatte..." #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 msgid "Saved" -msgstr "" +msgstr "Gespeichert" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 msgid "Choose destination directory" diff --git a/src/calibre/translations/dynamic.py b/src/calibre/translations/dynamic.py new file mode 100644 index 0000000000..1c9f53e960 --- /dev/null +++ b/src/calibre/translations/dynamic.py @@ -0,0 +1,27 @@ +''' +Dynamic language lookup of translations for user-visible strings. +''' + +__license__ = 'GPL v3' +__copyright__ = '2008, Marshall T. Vandegrift ' + +import sys +from cStringIO import StringIO +from gettext import GNUTranslations, NullTranslations +from calibre.translations.compiled import translations + +__all__ = ['translate'] + +_CACHE = {} + +def translate(lang, text): + trans = None + if lang in _CACHE: + trans = _CACHE[lang] + elif lang in translations: + buf = StringIO(translations[lang]) + trans = GNUTranslations(buf) + _CACHE[lang] = trans + if trans is None: + return _(text) + return trans.ugettext(text) diff --git a/src/calibre/translations/el.po b/src/calibre/translations/el.po index c8fa2488fc..8d5f37167b 100644 --- a/src/calibre/translations/el.po +++ b/src/calibre/translations/el.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/es.po b/src/calibre/translations/es.po index b177ce7d17..524ace6e21 100644 --- a/src/calibre/translations/es.po +++ b/src/calibre/translations/es.po @@ -11,13 +11,13 @@ msgstr "" "Project-Id-Version: es\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-01-19 04:38+0000\n" -"PO-Revision-Date: 2009-01-19 06:30+0000\n" -"Last-Translator: Kovid Goyal \n" +"PO-Revision-Date: 2009-01-20 01:11+0000\n" +"Last-Translator: DiegoJ \n" "Language-Team: Spanish\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 @@ -382,6 +382,9 @@ msgid "" "preference to the autodetected one. With this option, the autodetected one " "is always used." msgstr "" +"Normalmente, si el archivo fuente ya tiene una Tabla de contenidos, se usa " +"esa en vez de la autodetectada. Con esta opción la autodetectada es la que " +"siempre se usa." #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:148 msgid "Control page layout" @@ -1748,7 +1751,7 @@ msgstr "Uso: rb-meta file.rb" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 msgid "Creating Mobipocket file from EPUB..." -msgstr "" +msgstr "Creando archivo Mobipocket de un EPUB..." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 msgid "%prog [options] myebook.mobi" @@ -1760,21 +1763,25 @@ msgstr "HTML MOBI en bruto guardado en" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 msgid "Mobipocket" -msgstr "" +msgstr "Mobipocket" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 msgid "Mobipocket-specific options." -msgstr "" +msgstr "Opciones específicas de Mobipocket" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 msgid "" "Compress file text using PalmDOC compression. Results in smaller files, but " "takes a long time to run." msgstr "" +"Comprimir archivo de texto usando compresión PalmDOC. Genera archivos de " +"menor tamaño, pero tarda bastante tiempo en terminar." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 msgid "Modify images to meet Palm device size limitations." msgstr "" +"Modificar imágenes para adecuarse a las limitecaiones de tamaño del " +"dispositivo de Palm" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "" @@ -1784,7 +1791,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "Profiles" -msgstr "" +msgstr "Perfiles" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 msgid "Source renderer profile. Default is 'Browser'." @@ -3396,7 +3403,7 @@ msgstr "Se necesita contraseña." #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 msgid "Aborting..." -msgstr "" +msgstr "Abortando..." #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 msgid "You" @@ -4404,11 +4411,11 @@ msgstr "No se puede guardar en disco" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 msgid "Saving to disk..." -msgstr "" +msgstr "Guardando al disco..." #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 msgid "Saved" -msgstr "" +msgstr "Guardado" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 msgid "Choose destination directory" @@ -5412,6 +5419,15 @@ msgid "" "\n" "For help on an individual command: %%prog command --help\n" msgstr "" +"%%prog orden [opciones] [argumentos]\n" +"\n" +"%%prog es la interfaz de línea de órdenes a la base de datos de libros de " +"calibre.\n" +"\n" +"orden es una de:\n" +" %s\n" +"\n" +"Para ver la ayuda a cada orden ejecuta: %%prog orden --help\n" #: /home/kovid/work/calibre/src/calibre/library/database2.py:1171 msgid "

Copying books to %s

" diff --git a/src/calibre/translations/fr.po b/src/calibre/translations/fr.po index 049297c2e8..322c1d72bf 100644 --- a/src/calibre/translations/fr.po +++ b/src/calibre/translations/fr.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" diff --git a/src/calibre/translations/gl.po b/src/calibre/translations/gl.po index cfa346b2fe..25492bc9d9 100644 --- a/src/calibre/translations/gl.po +++ b/src/calibre/translations/gl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/hu.po b/src/calibre/translations/hu.po index 382f778b87..878c4b6a4b 100644 --- a/src/calibre/translations/hu.po +++ b/src/calibre/translations/hu.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: calibre\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2009-01-19 04:38+0000\n" -"PO-Revision-Date: 2009-01-19 06:34+0000\n" -"Last-Translator: Kovid Goyal \n" +"PO-Revision-Date: 2009-01-20 11:05+0000\n" +"Last-Translator: Molnár Gábor \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 @@ -330,6 +330,11 @@ msgid "" "if your source file contains a very large number of page breaks, you should " "turn off splitting on page breaks." msgstr "" +"Oldaltörésnél ne legyen szétvágás. Normális esetben a bemeneti fájlok minden " +"oldaltörésnél két részre lesznek vágva. Ez olyan e-könyv formátumot " +"eredmenyez, amelyet gyorsabban, kevesebb erőforrást igényelve lehet " +"beolvasni. Ez a művelet azonban lassú, és ha a forrásfájlod sok oldaltörést " +"tartalmaz, akkor érdemes alkalmazni ezt az opciót." #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:128 msgid "" @@ -339,6 +344,11 @@ msgid "" "trying\n" "to auto-generate a Table of Contents.\n" msgstr "" +"Az automatkius tartalomjegyzék generálásás beállítása. Ha egy OPF fájllal " +"dolgozunk\n" +"és a fájlban található tartalomjegyzék, akkor azt használja a generált " +"tartalomjegyzék\n" +"helyett.\n" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:134 msgid "" @@ -390,6 +400,10 @@ msgid "" "placed in. See http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX for " "an overview of the NCX format." msgstr "" +"Egy .ncx fájl helye, amely tartalmazza ennek a könyvnek a tartalomjegyzékét. " +"Az NCX fájlnak a saját könyvtárához viszonyított linkeket kell tartalmaznia, " +"nem abszolút linkeket. Áttekintés az NCX formátumról: " +"http://www.niso.org/workrooms/daisy/Z39-86-2005.html#NCX" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:146 msgid "" @@ -622,6 +636,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/html.py:897 msgid "Output HTML is \"pretty printed\" for easier parsing by humans" msgstr "" +"A kimenet HTML kód \"szépen formázott\" lesz a könnyebb olvashatóság kedvéért" #: /home/kovid/work/calibre/src/calibre/ebooks/html.py:903 msgid "" @@ -737,6 +752,8 @@ msgid "" "Render HTML tables as blocks of text instead of actual tables. This is " "neccessary if the HTML contains very large or complex tables." msgstr "" +"A HTML táblázatokat alakítsa át szövegblokkokká. Ez akkor szükséges, ha a " +"HTML nagy vagy bonyolult táblázatokat tartalmaz." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:99 msgid "" @@ -773,12 +790,15 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:112 msgid "Add extra spacing below the header. Default is %default px." msgstr "" +"Hagyjon ki ennyi helyet a fejléc alatt. Az alapértelmezés %default pixel." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:114 msgid "" "Override the CSS. Can be either a path to a CSS stylesheet or a string. If " "it is a string it is interpreted as CSS." msgstr "" +"Használja formázáshoz a következő CSS-t. Lehet egy útvonal egy CSS fájlhoz, " +"vagy maga a CSS kód." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:116 msgid "" @@ -819,31 +839,35 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:137 msgid "Left margin of page. Default is %default px." -msgstr "" +msgstr "Bal margó mérete. Alapértelmezés: %default pixel." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:139 msgid "Right margin of page. Default is %default px." -msgstr "" +msgstr "Jobb margó mérete. Alapértelmezés: %default pixel." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:141 msgid "Top margin of page. Default is %default px." -msgstr "" +msgstr "Felső margó mérete. Alapértelmezés: %default pixel." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:143 msgid "Bottom margin of page. Default is %default px." -msgstr "" +msgstr "Alsó margó mérete. Alapértelmezés: %default pixel." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:145 msgid "" "Render tables in the HTML as images (useful if the document has large or " "complex tables)" msgstr "" +"A HTML táblázatokat képként szúrja be a szövegbe. Ez bonyolult vagy nagy " +"táblázatoknál hasznos." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:147 msgid "" "Multiply the size of text in rendered tables by this factor. Default is " "%default" msgstr "" +"A betűméret szorzótényezője. Ennyiszer lesz nagyobb minden betű. " +"Alapértelmezés: %default" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:152 msgid "" @@ -857,6 +881,8 @@ msgid "" "A regular expression. tags whose href matches will be ignored. Defaults " "to %default" msgstr "" +"Azok az tag-ek, amelyek illeszkednek erre a reguláris kifejezésre nem " +"fognak szerepelni a kimenetben. Alapértelmezés: %default" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:160 msgid "Don't add links to the table of contents." @@ -871,6 +897,9 @@ msgid "" "The regular expression used to detect chapter titles. It is searched for in " "heading tags (h1-h6). Defaults to %default" msgstr "" +"Reguláris kifejezés, amely a fejezetcímek automatikus felismeréséhez " +"használatos. A h1-h6 tag-ekben keresünk illeszkedést. Alapértelmezés: " +"%default" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:170 msgid "" @@ -897,6 +926,8 @@ msgstr "" msgid "" "Force a page break before tags whose names match this regular expression." msgstr "" +"Sortörés beszúrása azon tag-ek előtt amelyek neve illeszkedik erre a " +"reguláris kifejezésre." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:184 msgid "" @@ -913,16 +944,21 @@ msgstr "Az automatikusan észlelt fejezetek hozzáadása a tartalomjegyzékhez." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:190 msgid "Preprocess Baen HTML files to improve generated LRF." msgstr "" +"A Baen HTML fájlok előfeldolgozása a jobb minőségű kimenet érdekében." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:192 msgid "" "You must add this option if processing files generated by pdftohtml, " "otherwise conversion will fail." msgstr "" +"Ezt a kapcsolót abban az esetben kell használnod, ha a HTML fájlt a " +"pdftohtml program generálta, ellenkező esetben nem lesz sikeres a " +"konvertálás!" #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:194 msgid "Use this option on html0 files from Book Designer." msgstr "" +"Ezt a kapcsolót a Book Designer program html0 fájljaihoz kell használni." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:197 msgid "" @@ -957,6 +993,8 @@ msgid "" "Minimize memory usage at the cost of longer processing times. Use this " "option if you are on a memory constrained machine." msgstr "" +"Memória használat minimalizálása hosszabb feldolgozási időért cserébe. Kevés " +"memóriával rendelkező számítógépeken érdemes használni." #: /home/kovid/work/calibre/src/calibre/ebooks/lrf/__init__.py:221 msgid "" diff --git a/src/calibre/translations/it.po b/src/calibre/translations/it.po index 7c1bbc3ab6..ec0ac27baf 100644 --- a/src/calibre/translations/it.po +++ b/src/calibre/translations/it.po @@ -15,7 +15,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" diff --git a/src/calibre/translations/nb.po b/src/calibre/translations/nb.po index f7955bbf4b..76f0edd74a 100644 --- a/src/calibre/translations/nb.po +++ b/src/calibre/translations/nb.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/nds.po b/src/calibre/translations/nds.po index 1d445ed256..cbd1eaa204 100644 --- a/src/calibre/translations/nds.po +++ b/src/calibre/translations/nds.po @@ -8,13 +8,13 @@ msgstr "" "Project-Id-Version: de\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-01-19 04:38+0000\n" -"PO-Revision-Date: 2009-01-10 09:58+0000\n" +"PO-Revision-Date: 2009-01-19 21:19+0000\n" "Last-Translator: S. Dorscht \n" "Language-Team: American English \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" @@ -1836,7 +1836,7 @@ msgstr "Benutzung: rb-meta file.rb" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/from_any.py:52 msgid "Creating Mobipocket file from EPUB..." -msgstr "" +msgstr "Erstelle Mobipocket Datei aus EPUB..." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/reader.py:505 msgid "%prog [options] myebook.mobi" @@ -1848,47 +1848,51 @@ msgstr "Original MOBI HTML gespeichert in" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:501 msgid "Mobipocket" -msgstr "" +msgstr "Mobipocket" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:502 msgid "Mobipocket-specific options." -msgstr "" +msgstr "Einstellungen speziell für Mobipocket." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:505 msgid "" "Compress file text using PalmDOC compression. Results in smaller files, but " "takes a long time to run." msgstr "" +"Textdatei mit PalmDOC compression komprimieren. Ergibt kleinere Dateien, " +"dauert aber länger beim Start." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:509 msgid "Modify images to meet Palm device size limitations." -msgstr "" +msgstr "Bilder auf die Größenlimitation von Palm Geräten einstellen." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "" "Device renderer profiles. Affects conversion of default font sizes and " "rasterization resolution. Valid profiles are: %s." msgstr "" +"Profile der Gerätedarstellung. Betrifft das Konvertieren mit " +"voreingestellten Schriftgrößen und Rasterauflösung. Vorhandene Profile: %s." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:511 msgid "Profiles" -msgstr "" +msgstr "Profile" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:516 msgid "Source renderer profile. Default is 'Browser'." -msgstr "" +msgstr "Profil der Quellendarstellung. Voreinstellung ist 'Browser'." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:519 msgid "Destination renderer profile. Default is 'CybookG3'." -msgstr "" +msgstr "Profil der Zieldarstellung. Voreinstellung ist 'CybookG3'." #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:543 msgid "Unknown source profile %r" -msgstr "" +msgstr "Unbekanntes Profil der Quelle %r" #: /home/kovid/work/calibre/src/calibre/ebooks/mobi/writer.py:547 msgid "Unknown destination profile %r" -msgstr "" +msgstr "Unbekanntes Profil des Ziels %r" #: /home/kovid/work/calibre/src/calibre/ebooks/odt/to_oeb.py:57 msgid "The output directory. Defaults to the current directory." @@ -3513,7 +3517,7 @@ msgstr "Passwort erforderlich" #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/progress.py:42 msgid "Aborting..." -msgstr "" +msgstr "Abbruch läuft ..." #: /home/kovid/work/calibre/src/calibre/gui2/dialogs/scheduler.py:39 msgid "You" @@ -4548,11 +4552,11 @@ msgstr "Speichern auf Festplatte nicht möglich" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:973 msgid "Saving to disk..." -msgstr "" +msgstr "Speichere auf Festplatte..." #: /home/kovid/work/calibre/src/calibre/gui2/main.py:978 msgid "Saved" -msgstr "" +msgstr "Gespeichert" #: /home/kovid/work/calibre/src/calibre/gui2/main.py:984 msgid "Choose destination directory" diff --git a/src/calibre/translations/nl.po b/src/calibre/translations/nl.po index 9ef792f265..9d25a4774a 100644 --- a/src/calibre/translations/nl.po +++ b/src/calibre/translations/nl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/pl.po b/src/calibre/translations/pl.po index a48fe0b292..3612507485 100644 --- a/src/calibre/translations/pl.po +++ b/src/calibre/translations/pl.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/pt.po b/src/calibre/translations/pt.po index 50b570f255..117041d23d 100644 --- a/src/calibre/translations/pt.po +++ b/src/calibre/translations/pt.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/ro.po b/src/calibre/translations/ro.po index 4d713d55f1..bedf0f0af2 100644 --- a/src/calibre/translations/ro.po +++ b/src/calibre/translations/ro.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/ru.po b/src/calibre/translations/ru.po index e5a83cb19c..f49f732fb1 100644 --- a/src/calibre/translations/ru.po +++ b/src/calibre/translations/ru.po @@ -13,7 +13,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "X-Poedit-Country: RUSSIAN FEDERATION\n" "X-Poedit-Language: Russian\n" diff --git a/src/calibre/translations/sk.po b/src/calibre/translations/sk.po index 7182455d0d..9fa033b2bf 100644 --- a/src/calibre/translations/sk.po +++ b/src/calibre/translations/sk.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/sl.po b/src/calibre/translations/sl.po index d4fc89c2e7..6dc8fbdf2c 100644 --- a/src/calibre/translations/sl.po +++ b/src/calibre/translations/sl.po @@ -7,13 +7,13 @@ msgstr "" "Project-Id-Version: calibre 0.4.17\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2009-01-19 04:38+0000\n" -"PO-Revision-Date: 2009-01-07 18:38+0000\n" -"Last-Translator: Kovid Goyal \n" +"PO-Revision-Date: 2009-01-19 08:55+0000\n" +"Last-Translator: Janko Slatenšek \n" "Language-Team: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" "Generated-By: pygettext.py 1.5\n" @@ -126,7 +126,7 @@ msgstr "Preberi meta podatke iz %s datotek" #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:166 msgid "Extract cover from comic files" -msgstr "" +msgstr "Pridobi naslovno stran iz stripa" #: /home/kovid/work/calibre/src/calibre/customize/builtins.py:186 msgid "Read metadata from ebooks in ZIP archives" @@ -280,13 +280,15 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:121 msgid "Path to the cover to be used for this book" -msgstr "" +msgstr "Pot do naslovne strani, ki bo uporabljena za to knjigo" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:124 msgid "" "Use the cover detected from the source file in preference to the specified " "cover." msgstr "" +"Uporabi naslovno stran zaznano v izvorni datoteki namesto v nastavitvah " +"specificirane naslovne strani." #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:126 msgid "" @@ -397,7 +399,7 @@ msgstr "" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:167 msgid "Print generated NCX file to stdout" -msgstr "" +msgstr "Izpiši ustvarjeno NCX datoteko na standardni izhod" #: /home/kovid/work/calibre/src/calibre/ebooks/epub/__init__.py:169 msgid "Keep intermediate files during processing by html2epub" diff --git a/src/calibre/translations/sv.po b/src/calibre/translations/sv.po index 22581fde06..49237f8acf 100644 --- a/src/calibre/translations/sv.po +++ b/src/calibre/translations/sv.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/translations/te.po b/src/calibre/translations/te.po index 4a9664ff23..a42b112018 100644 --- a/src/calibre/translations/te.po +++ b/src/calibre/translations/te.po @@ -14,7 +14,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2009-01-19 06:40+0000\n" +"X-Launchpad-Export-Date: 2009-01-20 17:04+0000\n" "X-Generator: Launchpad (build Unknown)\n" #: /home/kovid/work/calibre/src/calibre/customize/__init__.py:41 diff --git a/src/calibre/web/feeds/news.py b/src/calibre/web/feeds/news.py index 85ed39a16d..6da6383210 100644 --- a/src/calibre/web/feeds/news.py +++ b/src/calibre/web/feeds/news.py @@ -532,7 +532,9 @@ class BasicNewsRecipe(object, LoggingInterface): if body is not None: templ = self.navbar.generate(False, f, a, feed_len, not self.has_single_feed, - url, __appname__, center=self.center_navbar) + url, __appname__, + center=self.center_navbar, + extra_css=self.extra_css) elem = BeautifulSoup(templ.render(doctype='xhtml').decode('utf-8')).find('div') body.insert(0, elem) if self.remove_javascript: @@ -575,7 +577,8 @@ class BasicNewsRecipe(object, LoggingInterface): def feeds2index(self, feeds): templ = templates.IndexTemplate() - return templ.generate(self.title, self.timefmt, feeds).render(doctype='xhtml') + return templ.generate(self.title, self.timefmt, feeds, + extra_css=self.extra_css).render(doctype='xhtml') @classmethod def description_limiter(cls, src): @@ -626,7 +629,8 @@ class BasicNewsRecipe(object, LoggingInterface): templ = templates.FeedTemplate() - return templ.generate(feed, self.description_limiter).render(doctype='xhtml') + return templ.generate(feed, self.description_limiter, + extra_css=self.extra_css).render(doctype='xhtml') def create_logger(self, feed_number, article_number): diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index f0687ece28..2b5652260d 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -22,7 +22,8 @@ recipe_modules = ['recipe_' + r for r in ( 'time_magazine', 'endgadget', 'fudzilla', 'nspm_int', 'nspm', 'pescanik', 'spiegel_int', 'themarketticker', 'tomshardware', 'xkcd', 'ftd', 'zdnet', 'joelonsoftware', 'telepolis', 'common_dreams', 'nin', 'tomshardware_de', - 'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', + 'pagina12', 'infobae', 'ambito', 'elargentino', 'sueddeutsche', 'the_age', + 'laprensa', )] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/recipe_laprensa.py b/src/calibre/web/feeds/recipes/recipe_laprensa.py new file mode 100644 index 0000000000..55bb8778a3 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_laprensa.py @@ -0,0 +1,50 @@ +#!/usr/bin/env python + +__license__ = 'GPL v3' +__copyright__ = '2008, Darko Miletic ' +''' +laprensa.com.ar +''' +import urllib + +from calibre.web.feeds.news import BasicNewsRecipe + +class LaPrensa(BasicNewsRecipe): + title = 'La Prensa' + __author__ = 'Darko Miletic' + description = 'Informacion Libre las 24 horas' + oldest_article = 7 + max_articles_per_feed = 100 + no_stylesheets = True + use_embedded_content = False + encoding = 'cp1252' + cover_url = 'http://www.laprensa.com.ar/imgs/logo.gif' + + html2lrf_options = [ + '--comment' , description + , '--category' , 'news, Argentina' + , '--publisher' , title + ] + + feeds = [ + (u'Politica' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=4' ) + ,(u'Economia' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=5' ) + ,(u'Opinion' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=6' ) + ,(u'El Mundo' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=7' ) + ,(u'Actualidad' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=8' ) + ,(u'Deportes' , u'http://www.laprensa.com.ar/Rss.aspx?Rss=9' ) + ,(u'Espectaculos', u'http://www.laprensa.com.ar/Rss.aspx?Rss=10') + ] + + def print_version(self, url): + return url.replace('.note.aspx','.NotePrint.note.aspx') + + def get_article_url(self, article): + raw = article.get('link', None).encode('utf8') + final = urllib.quote(raw,':/') + return final + + def preprocess_html(self, soup): + del soup.body['onload'] + return soup + diff --git a/src/calibre/web/feeds/recipes/recipe_new_yorker.py b/src/calibre/web/feeds/recipes/recipe_new_yorker.py index f5ce85b351..f8ef5bc8cc 100644 --- a/src/calibre/web/feeds/recipes/recipe_new_yorker.py +++ b/src/calibre/web/feeds/recipes/recipe_new_yorker.py @@ -16,6 +16,14 @@ class NewYorker(BasicNewsRecipe): max_articles_per_feed = 100 no_stylesheets = False use_embedded_content = False + extra_css = ''' + .calibre_feed_list {font-size:xx-small} + .calibre_article_list {font-size:xx-small} + .calibre_feed_title {font-size:normal} + .calibre_recipe_title {font-size:normal} + .calibre_feed_description {font-size:xx-small} + ''' + keep_only_tags = [ dict(name='div' , attrs={'id':'printbody' }) diff --git a/src/calibre/web/feeds/recipes/recipe_the_age.py b/src/calibre/web/feeds/recipes/recipe_the_age.py new file mode 100644 index 0000000000..8bedc50cd5 --- /dev/null +++ b/src/calibre/web/feeds/recipes/recipe_the_age.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +__license__ = 'GPL v3' +__copyright__ = '2009, Matthew Briggs ' +__docformat__ = 'restructuredtext en' + +''' +theage.com.au +''' +from calibre import strftime +from calibre.web.feeds.news import BasicNewsRecipe +from calibre.ebooks.BeautifulSoup import BeautifulSoup + + +class TheAge(BasicNewsRecipe): + + title = 'The Age' + description = 'Business News, World News and Breaking News in Melbourne, Australia' + __author__ = 'Matthew Briggs' + + def get_browser(self): + br = BasicNewsRecipe.get_browser() + br.set_handle_refresh(False) + return br + + def parse_index(self): + + soup = BeautifulSoup(self.browser.open('http://www.theage.com.au/text/').read()) + + feeds, articles = [], [] + feed = None + + + for tag in soup.findAll(['h3', 'a']): + if tag.name == 'h3': + if articles: + feeds.append((feed, articles)) + articles = [] + feed = self.tag_to_string(tag) + elif feed is not None and tag.has_key('href') and tag['href'].strip(): + url = tag['href'].strip() + if url.startswith('/'): + url = 'http://www.theage.com.au' + url + title = self.tag_to_string(tag) + articles.append({ + 'title': title, + 'url' : url, + 'date' : strftime('%a, %d %b'), + 'description' : '', + 'content' : '', + }) + + return feeds + + + diff --git a/src/calibre/web/feeds/templates.py b/src/calibre/web/feeds/templates.py index b2b96bd9a4..1a6a574129 100644 --- a/src/calibre/web/feeds/templates.py +++ b/src/calibre/web/feeds/templates.py @@ -32,6 +32,11 @@ class NavBarTemplate(Template): xmlns:py="http://genshi.edgewall.org/" > + + +