python-ebooklib-0.15~ds0.orig/0000700000175000017500000000000012326462732016165 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/0000700000175000017500000000000012326462732017631 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/04_markdown_parse/0000700000175000017500000000000012326462732023150 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/04_markdown_parse/README.md0000644000175000017500000000041012326461175024434 0ustar alessioalessio# epub2markdown This is just a simple example and not utility script you should use for converting your ebooks. ## Usage epub2markdown my_ebook.epub ## Dependencies You need to install [Pandoc](http://johnmacfarlane.net/pandoc/) for this script to work. python-ebooklib-0.15~ds0.orig/samples/04_markdown_parse/epub2markdown.py0000755000175000017500000000240612326461175026321 0ustar alessioalessio#!/usr/bin/env python import sys import subprocess import os import os.path from ebooklib import epub # This is just a basic example which can easily break in real world. if __name__ == '__main__': # read epub book = epub.read_epub(sys.argv[1]) # get base filename from the epub base_name = os.path.basename(os.path.splitext(sys.argv[1])[0]) for item in book.items: # convert into markdown if this is html if isinstance(item, epub.EpubHtml): proc = subprocess.Popen(['pandoc', '-f', 'html', '-t', 'markdown', '-'], stdin=subprocess.PIPE, stdout=subprocess.PIPE ) content, error = proc.communicate(item.content) file_name = os.path.splitext(item.file_name)[0]+'.md' else: file_name = item.file_name content = item.content # create needed directories dir_name = '%s/%s' % (base_name, os.path.dirname(file_name)) if not os.path.exists(dir_name): os.makedirs(dir_name) print '>> ', file_name # write content to file f = open('%s/%s' % (base_name, file_name), 'w') f.write(content) f.close() python-ebooklib-0.15~ds0.orig/samples/03_advanced_create/0000700000175000017500000000000012326462732023223 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/03_advanced_create/README.md0000644000175000017500000000020112326461175024505 0ustar alessioalessioAdvanced create =============== Create simple EPUB3 using some of advanced features of EbookLib. ## Start python create.pypython-ebooklib-0.15~ds0.orig/samples/03_advanced_create/create.py0000644000175000017500000000451412326461175025056 0ustar alessioalessio# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # intro chapter c1 = epub.EpubHtml(title='Introduction', file_name='intro.xhtml', lang='hr') c1.content=u'

Introduction

Introduction paragraph where i explain what is happening.

' # defube style style = '''BODY { text-align: justify;}''' default_css = epub.EpubItem(uid="style_default", file_name="style/default.css", media_type="text/css", content=style) book.add_item(default_css) # about chapter c2 = epub.EpubHtml(title='About this book', file_name='about.xhtml') c2.content='

About this book

Helou, this is my book! There are many books, but this one is mine.

' c2.set_language('hr') c2.properties.append('rendition:layout-pre-paginated rendition:orientation-landscape rendition:spread-none') c2.add_item(default_css) # add chapters to the book book.add_item(c1) book.add_item(c2) # create table of contents # - add manual link # - add section # - add auto created links to chapters book.toc = (epub.Link('intro.xhtml', 'Introduction', 'intro'), (epub.Section('Languages'), (c1, c2)) ) # add navigation files book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) # define css style style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' # add css file nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) # create spine book.spine = ['nav', c1, c2] # create epub file epub.write_epub('test.epub', book, {}) python-ebooklib-0.15~ds0.orig/samples/README.md0000644000175000017500000000062412326461175021124 0ustar alessioalessioEbookLib Samples ================ * 01_sample_create Create simple EPUB with two chapters and custom CSS for the navigation. * 02_cover_create Same as 01_sample_create but with cover page. * 03_advanced_create Creates EPUB but uses some advanced options from the library. * 04_markdown_parse Simple script which creates static markdown files + images from your EPUB. * 05_plugins_createpython-ebooklib-0.15~ds0.orig/samples/05_plugins_create/0000700000175000017500000000000012326462732023141 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/05_plugins_create/README.md0000644000175000017500000000012112326461175024424 0ustar alessioalessioPlugins ======= How to make your useless plugin. ## Start python create.pypython-ebooklib-0.15~ds0.orig/samples/05_plugins_create/create.py0000644000175000017500000000537412326461175025001 0ustar alessioalessio# coding=utf-8 from ebooklib import epub from ebooklib.plugins.base import BasePlugin class SamplePlugin(BasePlugin): NAME = 'Sample Plugin' # Very useless but example of what can be done def html_before_write(self, book, chapter): from urlparse import urlparse, urljoin from lxml import html, etree utf8_parser = html.HTMLParser(encoding='utf-8') tree = html.document_fromstring(chapter.content, parser=utf8_parser) root = tree.getroottree() if len(root.find('body')) != 0: body = tree.find('body') for _link in body.xpath("//a[@class='test']"): _link.set('href', 'http://www.binarni.net/') chapter.content = etree.tostring(tree, pretty_print=True, encoding='utf-8') if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # intro chapter c1 = epub.EpubHtml(title='Introduction', file_name='intro.xhtml', lang='en') c1.content=u'

Introduction

Introduction paragraph with a link where i explain what is happening.

' # about chapter c2 = epub.EpubHtml(title='About this book', file_name='about.xhtml') c2.content='

About this book

Helou, this is my book! There are many books, but this one is mine.

' # add chapters to the book book.add_item(c1) book.add_item(c2) # create table of contents # - add section # - add auto created links to chapters book.toc = (epub.Link('intro.xhtml', 'Introduction', 'intro'), (epub.Section('Languages'), (c1, c2)) ) # add navigation files book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) # define css style style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' # add css file nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) # create spine book.spine = ['nav', c1, c2] opts = {'plugins': [SamplePlugin()]} # create epub file epub.writeEPUB('test.epub', book, opts) python-ebooklib-0.15~ds0.orig/samples/01_basic_create/0000700000175000017500000000000012326462732022535 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/01_basic_create/README.md0000644000175000017500000000012112326461175024020 0ustar alessioalessioBasic create ============ Simple EPUB3 creation. ## Start python create.pypython-ebooklib-0.15~ds0.orig/samples/01_basic_create/create.py0000644000175000017500000000365512326461175024375 0ustar alessioalessio# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # intro chapter c1 = epub.EpubHtml(title='Introduction', file_name='intro.xhtml', lang='en') c1.content=u'

Introduction

Introduction paragraph where i explain what is happening.

' # about chapter c2 = epub.EpubHtml(title='About this book', file_name='about.xhtml') c2.content='

About this book

Helou, this is my book! There are many books, but this one is mine.

' # add chapters to the book book.add_item(c1) book.add_item(c2) # create table of contents # - add section # - add auto created links to chapters book.toc = (epub.Link('intro.xhtml', 'Introduction', 'intro'), (epub.Section('Languages'), (c1, c2)) ) # add navigation files book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) # define css style style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' # add css file nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) # create spine book.spine = ['nav', c1, c2] # create epub file epub.write_epub('test.epub', book, {}) python-ebooklib-0.15~ds0.orig/samples/02_cover_create/0000700000175000017500000000000012326462732022573 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/samples/02_cover_create/README.md0000644000175000017500000000014112326461175024060 0ustar alessioalessioCover support ============= Create simple EPUB3 with cover page. ## Start python create.pypython-ebooklib-0.15~ds0.orig/samples/02_cover_create/create.py0000644000175000017500000000415712326461175024431 0ustar alessioalessio# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() # add metadata book.set_identifier('sample123456') book.set_title('Sample book') book.set_language('en') book.add_author('Aleksandar Erkalovic') # add cover image book.set_cover("image.jpg", open('cover.jpg', 'r').read()) # intro chapter c1 = epub.EpubHtml(title='Introduction', file_name='intro.xhtml', lang='hr') c1.content=u'

Introduction

Introduction paragraph where i explain what is happening.

' # about chapter c2 = epub.EpubHtml(title='About this book', file_name='about.xhtml') c2.content='

About this book

Helou, this is my book! There are many books, but this one is mine.

Cover Image

' # add chapters to the book book.add_item(c1) book.add_item(c2) # create table of contents # - add manual link # - add section # - add auto created links to chapters book.toc = (epub.Link('intro.xhtml', 'Introduction', 'intro'), (epub.Section('Languages'), (c1, c2)) ) # add navigation files book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) # define css style style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' # add css file nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) # create spin, add cover page as first page book.spine = ['cover', 'nav', c1, c2] # create epub file epub.write_epub('test.epub', book, {}) python-ebooklib-0.15~ds0.orig/samples/02_cover_create/cover.jpg0000644000175000017500000025305412326461175024436 0ustar alessioalessio*ExifMM*bj(1 r2i ' 'Adobe Photoshop CS6 (Macintosh)2013:02:09 13:28:28N"*(2HH XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ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7އrK$8G_G~ꪶk/Wo+Ey}?H޾̻"$.C$KyHI1OTI%)$IJI$RL5.q hԓVt̛=<|.cev1Θ.۵?ԔI$RI$I%)$IOTI%)$IJI$Ss;}'c< 529տd?EWk쎏I e%h4Ss6nغ>8CϜ ,ߵcuQ]Z %C cZ 3~%7~  '-+k>+YeM `C[GnŤI$$I)I$JTI%)$IL-V \}`s1FNAoYC2wM~lЇuZN]./+thFݻcl+r*mQLnl`wwV,l2K} q5v?+;Xs)Yǵlſ!ζRm8/m/[__ëiy2DOYpEu6Sىsqye[GlS.`5w ^׊ "5KWMKl[ɧvVVKs&ouǵ5huj!SNkzL9}? u?~"7/&CJEF{[[Yؽ ^{quW($IJI$STI%)$IM, jy1oZB>adzOk_ӁTכëN+)}.vW_}E 7XZ5 ׁs j㱮sxo%svD2ݍhѕ>vwk}yog[{o\^\-gG?W &ZZzUkqkWv;q~KrC[I$I$TI%)$IJT:t>Ŏ @]FtVc%<eĂƀL( uOP@!L GaL:r's̡II,%^ y^qiѕy J{4]O2׿zjdEmd]]?D Dfy8&ZIUt;ڱz?Mn&6Jo0:atI)I$JRI$TI%)$IJY_Z4Xַ3 ߵj8fHr1/t>J|tdlqm&V]6۶"\[~oekr:}o0= ;m0~S:zu^jw{u%=sS6j`X a;u\dg])hX/ezmi~\f9AkZ^ӡ}߼׵j( 3\_k]nsMv=/QO$N6k/ǺVCK1oܵ)GCϩ8V1v)I$JRI$'Photoshop 3.08BIMZ%GZ%G8BIM%]tn۾9y\8BIM: printOutputPstSboolInteenumInteClrmprintSixteenBitbool printerNameTEXTprintProofSetupObjc Proof Setup proofSetupBltnenum builtinProof proofCMYK8BIM;-printOutputOptionsCptnboolClbrboolRgsMboolCrnCboolCntCboolLblsboolNgtvboolEmlDboolIntrboolBckgObjcRGBCRd doub@oGrn doub@oBl doub@oBrdTUntF#RltBld UntF#RltRsltUntF#Pxl@R vectorDataboolPgPsenumPgPsPgPCLeftUntF#RltTop UntF#RltScl UntF#Prc@YcropWhenPrintingboolcropRectBottomlong cropRectLeftlong cropRectRightlong cropRectToplong8BIMHH8BIM&?8BIM x8BIM8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM@@8BIM8BIM]NThe-binary-chronicesNnullboundsObjcRct1Top longLeftlongBtomlongRghtlongNslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongNurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM8BIM  ~| XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-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$JRI$8BIM!UAdobe PhotoshopAdobe Photoshop CS68BIMhttp://ns.adobe.com/xap/1.0/ B45851E6EC9E130BE35D35FB857AB355 XICC_PROFILE HLinomntrRGB XYZ  1acspMSFTIEC sRGB-HP cprtP3desclwtptbkptrXYZgXYZ,bXYZ@dmndTpdmddvuedLview$lumimeas $tech0 rTRC< gTRC< bTRC< textCopyright (c) 1998 Hewlett-Packard CompanydescsRGB IEC61966-2.1sRGB IEC61966-2.1XYZ QXYZ XYZ o8XYZ bXYZ $descIEC http://www.iec.chIEC http://www.iec.chdesc.IEC 61966-2.1 Default RGB colour space - sRGB.IEC 61966-2.1 Default RGB colour space - sRGBdesc,Reference Viewing Condition in IEC61966-2.1,Reference Viewing Condition in IEC61966-2.1view_. \XYZ L VPWmeassig CRT curv #(-27;@EJOTY^chmrw| %+28>ELRY`gnu| &/8AKT]gqz !-8COZfr~ -;HUcq~ +:IXgw'7HYj{+=Oat 2FZn  % : O d y  ' = T j " 9 Q i  * C \ u & @ Z t .Id %A^z &Ca~1Om&Ed#Cc'Ij4Vx&IlAe@e Ek*Qw;c*R{Gp@j>i  A l !!H!u!!!"'"U"""# #8#f###$$M$|$$% %8%h%%%&'&W&&&''I'z''( (?(q(())8)k))**5*h**++6+i++,,9,n,,- -A-v--..L.../$/Z///050l0011J1112*2c223 3F3334+4e4455M555676r667$7`7788P8899B999:6:t::;-;k;;<' >`>>?!?a??@#@d@@A)AjAAB0BrBBC:C}CDDGDDEEUEEF"FgFFG5G{GHHKHHIIcIIJ7J}JK KSKKL*LrLMMJMMN%NnNOOIOOP'PqPQQPQQR1R|RSS_SSTBTTU(UuUVV\VVWDWWX/X}XYYiYZZVZZ[E[[\5\\]']x]^^l^__a_``W``aOaabIbbcCccd@dde=eef=ffg=ggh?hhiCiijHjjkOkklWlmm`mnnknooxop+ppq:qqrKrss]sttptu(uuv>vvwVwxxnxy*yyzFz{{c{|!||}A}~~b~#G k͂0WGrׇ;iΉ3dʋ0cʍ1fΏ6n֑?z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eKbfHnbz;'eVSǑZ[byT℻#hٹM Js@8d(jԟ#6(TԜ4JIӁ )o˜+{0K0-o9&h,9U9.0^*\XwpܼcF p Xq6Ȇd~U^el-.<+DžMDt3XU7տ8$LҋKJqvN8󎽯4y4|1!®*bYb }?*'q~hf$gM.*'v*UثWb]v*UثWb]v*UثWb]N*UثWb]v*UثWb]v*UثWb]v*UثxV^ r&qW鳬RG*@biQoY;ҡRips߳&(Mm!wzV-v*(ϔxOwY1yۨTeTS 1T ң_NK4R}6nV+cK[o@؎J*]LUN7YVX~"+U1TEn]17=O*\y  WJ*wS;h"DG7⦿È[eP1 M?Uc[Gx~EU{)MԞxvhPTӯ v:>< DC9':JtlU=-#Y%y3z8\U40^IVqYT1Vd0TTU.d.yR;?)=K2n9TN ~^8tWo]2' 0_Rb]v*UثWb]v*UثWb]v*UثWbN*UثWb]v*UثWb]v*UثWb]v*Uث ou |1]ڱ |U󭀡zLUi|b9>$еJ`v ֞u(b %@OiUoWڥ=(DdDCoYU/Pi"ӯ._qTK=[ YoR45\U~ԉTqu&nGb̷3Gm u$|GU8+bZ[=KdrzTEv=qJK;ȤQ"N木z bxhUWNlqTQbv/_J MtM=T֬ ?,U-gp}\UPM=}65I ]v*UثWb]v*UثWb]v*UثWb_N*UثWb]v*UثWb]v*UثWb]v*UتYOupW>b> |UX__T>>b8bMX 5ܞcx  ncC iT,ғljVaqLU/ԹV9sSMKAxҋrk%W,UoIc2}^jHP|P<)u)bKV'@68ij'cN7Qm&TH^D@G'q_\V%bX"F1 uSRB9J!4_^E45,޲kh~x=5,kdQM=CɌL#ys,bƼCi]y6jÓzV>إiǜ l$弄sWM[%eԘJ„zvX=/JN];*&~p?D[6_f]v*UثWb]v*UثWb]v*UثWbpython-ebooklib-0.15~ds0.orig/VERSION.txt0000644000175000017500000000001612326461175020062 0ustar alessioalessioEbookLib 0.15 python-ebooklib-0.15~ds0.orig/README.md0000644000175000017500000000357612326461175017471 0ustar alessioalessioAbout EbookLib ============== EbookLib is a Python library for managing EPUB2/EPUB3 and Kindle files. It's capable of reading and writing EPUB files programmatically (Kindle support is under development). The API is designed to be as simple as possible, while at the same time making complex things possible too. It has support for covers, table of contents, spine, guide, metadata and etc. Usage ===== Reading ------- from ebooklib import epub book = epub.read_epub('test.epub') for image in book.get_items_of_type(epub.ITEM_IMAGE): print image Writing ------- from ebooklib import epub book = epub.EpubBook() # set metadata book.set_identifier('id123456') book.set_title('Sample book') book.set_language('en') book.add_author('Author Authorowski') book.add_author('Danko Bananko', file_as='Gospodin Danko Bananko', role='ill', uid='coauthor') # create chapter c1 = epub.EpubHtml(title='Intro', file_name='chap_01.xhtml', lang='hr') c1.content=u'

Intro heading

Žaba je skočila u baru.

' # add chapter book.add_item(c1) # define Table Of Contents book.toc = (epub.Link('chap_01.xhtml', 'Introduction', 'intro'), (epub.Section('Simple book'), (c1, )) ) # add default NCX and Nav file book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) # define CSS style style = 'BODY {color: white;}' nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) # add CSS file book.add_item(nav_css) # basic spine book.spine = ['nav', c1] # write to the file epub.write_epub('test.epub', book, {}) License ======= EbookLib is licensed under the AGPL license. Authors ======= * Aleksandar Erkalovic * Borko Jandras python-ebooklib-0.15~ds0.orig/tests/0000700000175000017500000000000012326462732017327 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/tests/epub_booktype.py0000644000175000017500000001210412326461175022560 0ustar alessioalessio# coding=utf-8 import sys import os.path from ebooklib import epub from booki.editor import models def export_booktype(bookid): # Get Booktype Book try: booktype_book = models.Book.objects.get(url_title__iexact=bookid) except models.Book.DoesNotExist: print 'NO SUCH BOOK' sys.exit(-1) book_version = booktype_book.getVersion(None) # START CREATING THE BOOK book = epub.EpubBook() # set basic info book.set_identifier('booktype:%s' % booktype_book.url_title) book.set_title(booktype_book.title) book.set_language('en') # set description if booktype_book.description != '': book.add_metadata('DC', 'description', booktype_book.description) # set license lic = booktype_book.license if lic: book.add_metadata('DC', 'rights', lic.name) # The Contributors for Booktype book # book.add_author('Thea von Harbou', role='aut', uid='author') book.add_author('Aleksandar Erkalovic', role='aut', uid='author') book.add_author('Aleksandar Erkalovic', file_as='Aleksandar Erkalovic', role='ill', uid='illustrator') # set cover image img = open('cover.jpg', 'r').read() book.set_cover("image.jpg", img) toc = [] section = [] spine = ['cover', 'nav'] for chapter in book_version.getTOC(): if chapter.chapter: c1 = epub.EpubHtml(title=chapter.chapter.title, file_name='%s.xhtml' % (chapter.chapter.url_title, )) c1.add_link(href="style/default.css", rel="stylesheet", type="text/css") if chapter.chapter.title == 'Arabic': c1.set_language('ar') if chapter.chapter.title == 'Japanase': c1.set_language('jp') cont = chapter.chapter.content c1.content=cont book.add_item(c1) spine.append(c1) if len(section) > 1: section[1].append(c1) else: if len(section) > 0: toc.append(section[:]) section = [] section = [epub.Section(chapter.name), []] # this is section if len(section) > 0: toc.append(section[:]) for i, attachment in enumerate(models.Attachment.objects.filter(version=book_version)): try: f = open(attachment.attachment.name, "rb") blob = f.read() f.close() except (IOError, OSError), e: continue else: fn = os.path.basename(attachment.attachment.name.encode("utf-8")) itm = epub.EpubImage() itm.file_name = 'static/%s' % fn itm.content = blob book.add_item(itm) book.toc = toc print toc book.add_item(epub.EpubNcx()) book.add_item(epub.EpubNav()) style = ''' body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; text-align: justify; margin: 0; padding: 0; } p:last-child { padding-bottom: 2em; } p { text-indent: 1.5em; } p.image { text-indent: 0px; } P + P { margin-bottom: 5px; } h1 { margin-top: 0; text-transform: uppercase; font-weight: 200; border-bottom: 1px solid #808080; } img { max-width: 100%; max-height: 100%; } .highlight { font-size: 10px; } blockquote.quote { color: #66a; font-weight: normal; font-style: italic; margin: 1em 3em; } blockquote.quote p:before { content: '"'; } blockquote.quote p:after { content: '"'; } ''' default_css = epub.EpubItem(uid="style_default", file_name="style/default.css", media_type="text/css", content=style) book.add_item(default_css) style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) code_style = open('code.css', 'r').read() code_css = epub.EpubItem(uid="style_code", file_name="style/code.css", media_type="text/css", content=code_style) book.add_item(code_css) # this probably is not correct. should be able to define other properties also book.spine = spine from ebooklib.plugins import booktype, sourcecode opts = {'plugins': [booktype.BooktypeLinks(booktype_book), booktype.BooktypeFootnotes(booktype_book), sourcecode.SourceHighlighter() ] } # one plugin which looks for linked javascript # if available then add scripted propertie to the item # write book to the file epub.write_epub('test.epub', book, opts) if __name__ == '__main__': export_booktype(sys.argv[1]) python-ebooklib-0.15~ds0.orig/tests/epub_create.py0000644000175000017500000000476112326461175022201 0ustar alessioalessio# coding=utf-8 from ebooklib import epub if __name__ == '__main__': book = epub.EpubBook() book.set_identifier('id123456') book.set_title('This is my book') book.set_language('fi') book.add_metadata('DC', 'title', 'Naslov', {'id': 't1'}) book.add_metadata(None, 'meta', 'main', {'refines': '#t1', 'property': 'title-type'}) book.add_metadata('DC', 'title', 'Naslov', {'id': 't2'}) book.add_metadata(None, 'meta', 'edition', {'refines': '#t2', 'property': 'title-type'}) book.add_author('Mirko Bulaja') book.add_author('Danko Bananko', file_as='Gospodin Danko Bananko', role='ill', uid='coauthor') img = open('image.jpg', 'r').read() book.set_cover("image.jpg", img) # create chapters c1 = epub.EpubHtml(title='Intro 1', file_name='chap_01.xhtml', lang='hr') c1.set_content(u'

This is I!

This is something i am writing.

Šime Đodan ima puno posla.

') c2 = epub.EpubHtml(title='Intro 2', file_name=u'chap_02_đšž.xhtml') c2.set_content('

This is I!

Helou, helou!

Ovo je link

') c2.properties.append('rendition:layout-pre-paginated rendition:orientation-landscape rendition:spread-none') # add all the items book.add_item(c1) book.add_item(c2) book.toc = ( (epub.Section('Languages'), (c1, c2)), ) style = ''' @namespace epub "http://www.idpf.org/2007/ops"; body { font-family: Cambria, Liberation Serif, Bitstream Vera Serif, Georgia, Times, Times New Roman, serif; } h2 { text-align: left; text-transform: uppercase; font-weight: 200; } ol { list-style-type: none; } ol > li:first-child { margin-top: 0.3em; } nav[epub|type~='toc'] > ol > li > ol { list-style-type:square; } nav[epub|type~='toc'] > ol > li > ol > li { margin-top: 0.3em; } ''' nav_css = epub.EpubItem(uid="style_nav", file_name="style/nav.css", media_type="text/css", content=style) book.add_item(nav_css) # this should be maybe add by default or something book.add_item(epub.EpubNcx()) nav = epub.EpubNav() nav.add_item(nav_css) book.add_item(nav) # this probably is not correct. should be able to define other properties also book.spine = ['cover', 'nav', c1, c2] # write book to the file epub.write_epub('test.epub', book) print '------------' for x in nav.get_links_of_type('text/css'): print x python-ebooklib-0.15~ds0.orig/tests/epub_parse.py0000644000175000017500000000071512326461175022043 0ustar alessioalessioimport sys import ebooklib from ebooklib import epub from ebooklib.utils import debug book = epub.read_epub(sys.argv[1]) debug(book.metadata) debug(book.spine) debug(book.toc) #for it in book.items: # debug( it.get_type()) for x in book.get_items_of_type(ebooklib.ITEM_IMAGE): debug( x) from ebooklib.plugins import standard, tidyhtml opts = {'plugins': [standard.SyntaxPlugin(), tidyhtml.TidyPlugin()]} epub.write_epub('test.epub', book, opts) python-ebooklib-0.15~ds0.orig/MANIFEST.in0000644000175000017500000000007012326461175017732 0ustar alessioalessioinclude *.txt include *.md recursive-include docs *.txt python-ebooklib-0.15~ds0.orig/AUTHORS.txt0000644000175000017500000000011512326461175020062 0ustar alessioalessioAleksandar Erkalovic Borko Jandras python-ebooklib-0.15~ds0.orig/docs/0000700000175000017500000000000012330427407017110 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/docs/modules.rst0000644000175000017500000000007312326461175021331 0ustar alessioalessioModules ======= .. toctree:: :maxdepth: 4 ebooklib python-ebooklib-0.15~ds0.orig/docs/Makefile0000644000175000017500000001270412326461175020573 0ustar alessioalessio# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/EBookLib.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/EBookLib.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/EBookLib" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/EBookLib" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." python-ebooklib-0.15~ds0.orig/docs/ebooklib.rst0000644000175000017500000000074512326461175021455 0ustar alessioalessioebooklib Package ================ :mod:`ebooklib` Package ----------------------- .. automodule:: ebooklib :members: :undoc-members: :show-inheritance: :mod:`epub` Module ------------------ .. automodule:: ebooklib.epub :members: :undoc-members: :show-inheritance: :mod:`utils` Module ------------------- .. automodule:: ebooklib.utils :members: :undoc-members: :show-inheritance: Subpackages ----------- .. toctree:: ebooklib.plugins python-ebooklib-0.15~ds0.orig/docs/index.rst0000644000175000017500000000157312326461175020776 0ustar alessioalessio.. EBookLib documentation master file, created by sphinx-quickstart on Fri Apr 25 11:49:49 2014. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. Welcome to EBookLib's documentation! ==================================== EbookLib is a Python library for managing EPUB2/EPUB3 and Kindle files. It's capable of reading and writing EPUB files programmatically (Kindle support is under development). The API is designed to be as simple as possible, while at the same time making complex things possible too. It has support for covers, table of contents, spine, guide, metadata and more. EbookLib works with Python 2.7 and Python 3.3. Homepage: https://github.com/aerkalov/ebooklib/ .. toctree:: :maxdepth: 4 modules Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` python-ebooklib-0.15~ds0.orig/docs/_static/0000700000175000017500000000000012326462732020543 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/docs/_static/README0000644000175000017500000000011512326461175021432 0ustar alessioalessioFor some reason, readthedocs.org expects a docs/_static/ directory to exist. python-ebooklib-0.15~ds0.orig/docs/conf.py0000644000175000017500000002214112326461175020426 0ustar alessioalessio# -*- coding: utf-8 -*- # # EBookLib documentation build configuration file, created by # sphinx-quickstart on Fri Apr 25 11:49:49 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath('..')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'EBookLib' copyright = u'2013, Aleksandar Erkalovic' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '0.15' # The full version, including alpha/beta/rc tags. release = '0.15' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'EBookLibdoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'EBookLib.tex', u'EBookLib Documentation', u'Aleksandar Erkalovic', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'ebooklib', u'EBookLib Documentation', [u'Aleksandar Erkalovic'], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'EBookLib', u'EBookLib Documentation', u'Aleksandar Erkalovic', 'EBookLib', 'Python library for EPUB and Kindle formats.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. epub_title = u'EBookLib' epub_author = u'Aleksandar Erkalovic' epub_publisher = u'Aleksandar Erkalovic' epub_copyright = u'2013, Aleksandar Erkalovic' # The language of the text. It defaults to the language option # or en if the language is not set. #epub_language = '' # The scheme of the identifier. Typical schemes are ISBN or URL. #epub_scheme = '' # The unique identifier of the text. This can be a ISBN number # or the project homepage. #epub_identifier = '' # A unique identification for the text. #epub_uid = '' # A tuple containing the cover image and cover page html template filenames. #epub_cover = () # HTML files that should be inserted before the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_pre_files = [] # HTML files shat should be inserted after the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_post_files = [] # A list of files that should not be packed into the epub file. #epub_exclude_files = [] # The depth of the table of contents in toc.ncx. #epub_tocdepth = 3 # Allow duplicate toc entries. #epub_tocdup = True # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'http://docs.python.org/': None} python-ebooklib-0.15~ds0.orig/docs/ebooklib.plugins.rst0000644000175000017500000000137212326461175023132 0ustar alessioalessioplugins Package =============== :mod:`base` Module ------------------ .. automodule:: ebooklib.plugins.base :members: :undoc-members: :show-inheritance: :mod:`booktype` Module ---------------------- .. automodule:: ebooklib.plugins.booktype :members: :undoc-members: :show-inheritance: :mod:`sourcecode` Module ------------------------ .. automodule:: ebooklib.plugins.sourcecode :members: :undoc-members: :show-inheritance: :mod:`standard` Module ---------------------- .. automodule:: ebooklib.plugins.standard :members: :undoc-members: :show-inheritance: :mod:`tidyhtml` Module ---------------------- .. automodule:: ebooklib.plugins.tidyhtml :members: :undoc-members: :show-inheritance: python-ebooklib-0.15~ds0.orig/CHANGES.TXT0000644000175000017500000000000012326461175017636 0ustar alessioalessiopython-ebooklib-0.15~ds0.orig/.gitignore0000644000175000017500000000015012326461175020163 0ustar alessioalessio#ignore these in git listings EbookLib.egg-info dist build *.pyc *~ .emacs* .DS_Store .swp \#*# .#* \#* python-ebooklib-0.15~ds0.orig/MANIFEST0000644000175000017500000000013212326461175017324 0ustar alessioalessio# file GENERATED by distutils, do NOT edit setup.py ebooklib/__init__.py ebooklib/epub.py python-ebooklib-0.15~ds0.orig/ebooklib/0000700000175000017500000000000012326462732017753 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/ebooklib/epub.py0000644000175000017500000011466712326461175021311 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . import sys import os.path import zipfile import io import six import mimetypes import logging try: from urllib.parse import unquote except ImportError: from urllib import unquote from lxml import etree import ebooklib from ebooklib.utils import parse_string, parse_html_string # This really should not be here mimetypes.init() # Version of EPUB library VERSION = (0, 15, 0) NAMESPACES = {'XML': 'http://www.w3.org/XML/1998/namespace', 'EPUB': 'http://www.idpf.org/2007/ops', 'DAISY': 'http://www.daisy.org/z3986/2005/ncx/', 'OPF': 'http://www.idpf.org/2007/opf', 'CONTAINERNS': 'urn:oasis:names:tc:opendocument:xmlns:container', 'DC': "http://purl.org/dc/elements/1.1/", 'XHTML': 'http://www.w3.org/1999/xhtml'} # XML Templates CONTAINER_PATH = 'META-INF/container.xml' CONTAINER_XML = ''' ''' NCX_XML = ''' ''' NAV_XML = '''''' CHAPTER_XML = '''''' COVER_XML = ''' ''' IMAGE_MEDIA_TYPES = ['image/jpeg', 'image/jpg', 'image/png', 'image/svg+xml'] ## TOC elements class Section(object): def __init__(self, title): self.title = title class Link(object): def __init__(self, href, title, uid=None): self.href = href self.title = title self.uid = uid ## Exceptions class EpubException(Exception): def __init__(self, code, msg): self.code = code self.msg = msg def __str__(self): return repr(self.msg) ## Items class EpubItem(object): def __init__(self, uid=None, file_name='', media_type='', content=''): self.id = uid self.file_name = file_name self.media_type = media_type self.content = content self.is_linear = True self.book = None def get_id(self): return self.id def get_name(self): return self.file_name def get_type(self): """ Guess type according to the file extension. Not the best way to do it, but works for now. """ _, ext = os.path.splitext(self.get_name()) ext = ext.lower() for uid, ext_list in six.iteritems(ebooklib.EXTENSIONS): if ext in ext_list: return uid return ebooklib.ITEM_UNKNOWN def get_content(self, default=''): return self.content or default def set_content(self, content): self.content = content def __str__(self): return '' % self.id class EpubNcx(EpubItem): def __init__(self, uid='ncx', file_name='toc.ncx'): super(EpubNcx, self).__init__(uid=uid, file_name=file_name, media_type="application/x-dtbncx+xml") def __str__(self): return '' % self.id class EpubCover(EpubItem): def __init__(self, uid='cover-img', file_name=''): super(EpubCover, self).__init__(uid=uid, file_name=file_name) def __str__(self): return '' % (self.id, self.file_name) class EpubHtml(EpubItem): _template_name = 'chapter' def __init__(self, uid=None, file_name='', media_type='', content=None, title='', lang=None): super(EpubHtml, self).__init__(uid, file_name, media_type, content) self.title = title self.lang = lang self.links = [] self.properties = [] def is_chapter(self): return True def get_type(self): return ebooklib.ITEM_DOCUMENT def set_language(self, lang): self.lang = lang def get_language(self): return self.lang def add_link(self, **kwgs): self.links.append(kwgs) def get_links(self): return (link for link in self.links) def get_links_of_type(self, link_type): return (link for link in self.links if link.get('type', '') == link_type) def add_item(self, item): if item.get_type() == ebooklib.ITEM_STYLE: self.add_link(href=item.get_name(), rel="stylesheet", type="text/css") if item.get_type() == ebooklib.ITEM_SCRIPT: self.add_link(href=item.get_name(), type="text/javascript") def get_body_content(self): content = self.get_content() try: html_tree = parse_html_string(self.content) except: return '' html_root = html_tree.getroottree() if len(html_root.find('body')) != 0: body = html_tree.find('body') tree_str = etree.tostring(body, pretty_print=True, encoding='utf-8', xml_declaration=False) # this is so stupid if tree_str.startswith(''): n = tree_str.rindex('') return tree_str[7:n] return tree_str return '' def get_content(self, default=None): tree = parse_string(self.book.get_template(self._template_name)) tree_root = tree.getroot() tree_root.set('lang', self.lang or self.book.language) tree_root.attrib['{%s}lang' % NAMESPACES['XML']] = self.lang or self.book.language # add to the head also # try: html_tree = parse_html_string(self.content) except: return '' html_root = html_tree.getroottree() # create and populate head _head = etree.SubElement(tree_root, 'head') if self.title != '': _title = etree.SubElement(_head, 'title') _title.text = self.title for lnk in self.links: _lnk = etree.SubElement(_head, 'link', lnk) # this should not be like this # head = html_root.find('head') # if head is not None: # for i in head.getchildren(): # if i.tag == 'title' and self.title != '': # continue # _head.append(i) # create and populate body _body = etree.SubElement(tree_root, 'body') body = html_tree.find('body') if body is not None: for i in body.getchildren(): _body.append(i) tree_str = etree.tostring(tree, pretty_print=True, encoding='utf-8', xml_declaration=True) return tree_str def __str__(self): return '' % (self.id, self.file_name) class EpubCoverHtml(EpubHtml): def __init__(self, uid='cover', file_name='cover.xhtml', image_name='', title='Cover'): super(EpubCoverHtml, self).__init__(uid=uid, file_name=file_name, title=title) self.image_name = image_name self.is_linear = False def is_chapter(self): return False def get_content(self): self.content = self.book.get_template('cover') tree = parse_string(super(EpubCoverHtml, self).get_content()) tree_root = tree.getroot() images = tree_root.xpath('//xhtml:img', namespaces={'xhtml': NAMESPACES['XHTML']}) images[0].set('src', self.image_name) images[0].set('alt', self.title) tree_str = etree.tostring(tree, pretty_print=True, encoding='utf-8', xml_declaration=True) return tree_str def __str__(self): return '' % (self.id, self.file_name) class EpubNav(EpubHtml): def __init__(self, uid='nav', file_name='nav.xhtml', media_type="application/xhtml+xml"): super(EpubNav, self).__init__(uid=uid, file_name=file_name, media_type=media_type) def is_chapter(self): return False def __str__(self): return '' % (self.id, self.file_name) class EpubImage(EpubItem): def __init__(self): super(EpubImage, self).__init__() def get_type(self): return ebooklib.ITEM_IMAGE def __str__(self): return '' % (self.id, self.file_name) ## EpubBook class EpubBook(object): def __init__(self): self.EPUB_VERSION = None self.reset() # we should have options here def reset(self): "Initialises all needed variables to default values" self.uid = '' self.metadata = {} self.items = [] self.spine = [] self.guide = [] self.toc = [] self.IDENTIFIER_ID = 'id' self.FOLDER_NAME = 'EPUB' self._id_html = 0 self._id_image = 0 self._id_static = 0 self.title = '' self.language = 'en' self.templates = {'ncx': NCX_XML, 'nav': NAV_XML, 'chapter': CHAPTER_XML, 'cover': COVER_XML} self.add_metadata('OPF', 'generator', '', {'name': 'generator', 'content': 'Ebook-lib %s' % '.'.join([str(s) for s in VERSION])}) def set_identifier(self, uid): "Sets unique id for this epub" self.uid = uid self.add_metadata('DC', 'identifier', self.uid, {'id': self.IDENTIFIER_ID}) def set_title(self, title): "Set title. You can set multiple titles." self.title = title self.add_metadata('DC', 'title', self.title) def set_language(self, lang): "Set language for this epub. You can set multiple languages." self.language = lang self.add_metadata('DC', 'language', lang) def set_cover(self, file_name, content, create_page=True): "Set cover and create cover document if needed." # as it is now, it can only be called once c0 = EpubCover(file_name=file_name) c0.content = content self.add_item(c0) if create_page: c1 = EpubCoverHtml(image_name=file_name) self.add_item(c1) self.add_metadata(None, 'meta', '', {'name': 'cover', 'content': 'cover-img'}) def add_author(self, author, file_as=None, role=None, uid='creator'): "Add author for this document" self.add_metadata('DC', 'creator', author, {'id': uid}) if file_as: self.add_metadata(None, 'meta', file_as, {'refines': '#'+uid, 'property': 'file-as', 'scheme': 'marc:relators'}) if role: self.add_metadata(None, 'meta', role, {'refines': '#'+uid, 'property': 'role', 'scheme': 'marc:relators'}) def add_metadata(self, namespace, name, value, others = None): "Add metadata" if namespace in NAMESPACES: namespace = NAMESPACES[namespace] if namespace not in self.metadata: self.metadata[namespace] = {} if name not in self.metadata[namespace]: self.metadata[namespace][name] = [] self.metadata[namespace][name].append(( value, others)) def get_metadata(self, namespace, name): "Retrieve metadata" if namespace in NAMESPACES: namespace = NAMESPACES[namespace] return self.metadata[namespace][name] def add_item(self, item): if item.media_type == '': (has_guessed, media_type) = mimetypes.guess_type(item.get_name().lower()) if has_guessed: if media_type is not None: item.media_type = media_type else: item.media_type = has_guessed else: item.media_type = 'application/octet-stream' if not item.get_id(): # make chapter_, image_ and static_ configurable if isinstance(item, EpubHtml): item.id = 'chapter_%d' % self._id_html self._id_html += 1 elif isinstance(item, EpubImage): item.id = 'image_%d' % self._id_image self._id_image += 1 else: item.id = 'static_%d' % self._id_image self._id_image += 1 item.book = self self.items.append(item) return item def get_item_with_id(self, uid): for item in self.get_items(): if item.id == uid: return item return None def get_item_with_href(self, href): for item in self.get_items(): if item.get_name() == href: return item return None def get_items(self): return (item for item in self.items) def get_items_of_type(self, item_type): return (item for item in self.items if item.get_type() == item_type) def get_items_of_media_type(self, media_type): return (item for item in self.items if item.media_type == media_type) def set_template(self, name, value): self.templates[name] = value def get_template(self, name): return self.templates.get(name) ########################################################################################################### class EpubWriter(object): DEFAULT_OPTIONS = {'epub2_guide': True, 'epub3_landmark': True, 'landmark_title': 'Guide' } def __init__(self, name, book, options = None): self.file_name = name self.book = book self.options = dict(self.DEFAULT_OPTIONS) if options: self.options.update(options) def process(self): # should cache this html parsing so we don't do it for every plugin for plg in self.options.get('plugins', []): if hasattr(plg, 'before_write'): plg.before_write(self.book) for item in self.book.get_items(): if isinstance(item, EpubHtml): for plg in self.options.get('plugins', []): if hasattr(plg, 'html_before_write'): plg.html_before_write(self.book, item) def _write_container(self): container_xml = CONTAINER_XML % { 'folder_name' : self.book.FOLDER_NAME } self.out.writestr(CONTAINER_PATH, container_xml) def _write_opf_file(self): root = etree.Element('package', {'xmlns' : NAMESPACES['OPF'], 'unique-identifier' : self.book.IDENTIFIER_ID, 'version' : '3.0'}) root.attrib['prefix'] = 'rendition: http://www.ipdf.org/vocab/rendition/#' ## METADATA nsmap = {'dc': NAMESPACES['DC'], 'opf': NAMESPACES['OPF']} # This is really not needed # problem is uppercase/lowercase # for ns_name, values in six.iteritems(self.book.metadata): # if ns_name: # for n_id, ns_url in six.iteritems(NAMESPACES): # if ns_name == ns_url: # nsmap[n_id.lower()] = NAMESPACES[n_id] metadata = etree.SubElement(root, 'metadata', nsmap = nsmap) import datetime el = etree.SubElement(metadata, 'meta', {'property':'dcterms:modified'}) el.text = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ') for ns_name, values in six.iteritems(self.book.metadata): if ns_name == NAMESPACES['OPF']: for values in values.values(): for v in values: try: el = etree.SubElement(metadata, 'meta', v[1]) if v[0]: el.text = v[0] except ValueError: logging.error('Could not create metadata.') else: for name, values in six.iteritems(values): for v in values: try: if ns_name: el = etree.SubElement(metadata, '{%s}%s' % (ns_name, name), v[1]) else: el = etree.SubElement(metadata, '%s' % name, v[1]) el.text = v[0] except ValueError: logging.error('Could not create metadata "{}".'.format(name)) # MANIFEST manifest = etree.SubElement(root, 'manifest') _ncx_id = None # mathml, scripted, svg, remote-resources, and switch # nav # cover-image for item in self.book.get_items(): if isinstance(item, EpubNav): etree.SubElement(manifest, 'item', {'href': item.get_name(), 'id': item.id, 'media-type': item.media_type, 'properties': 'nav'}) elif isinstance(item, EpubNcx): _ncx_id = item.id etree.SubElement(manifest, 'item', {'href': item.file_name, 'id': item.id, 'media-type': item.media_type}) elif isinstance(item, EpubCover): etree.SubElement(manifest, 'item', {'href': item.file_name, 'id': item.id, 'media-type': item.media_type, 'properties': 'cover-image'}) else: opts = {'href': item.file_name, 'id': item.id, 'media-type': item.media_type} if hasattr(item, 'properties') and len(item.properties) > 0: opts['properties' ] = ' '.join(item.properties) etree.SubElement(manifest, 'item', opts) # SPINE spine = etree.SubElement(root, 'spine', {'toc': _ncx_id or 'ncx'}) for _item in self.book.spine: # this is for now # later we should be able to fetch things from tuple is_linear = True if isinstance(_item, tuple): item = _item[0] if len(_item) > 1: if _item[1] == 'no': is_linear = False else: item = _item if isinstance(item, EpubHtml): opts = {'idref': item.get_id()} if not item.is_linear or not is_linear: opts['linear'] = 'no' elif isinstance(item, EpubItem): opts = {'idref': item.get_id()} if not item.is_linear or not is_linear: opts['linear'] = 'no' else: opts = {'idref': item} try: itm = self.book.get_item_with_id(item) if not itm.is_linear or not is_linear: opts['linear'] = 'no' except: pass etree.SubElement(spine, 'itemref', opts) # GUIDE # - http://www.idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.6 if len(self.book.guide) > 0 and self.options.get('epub2_guide'): guide = etree.SubElement(root, 'guide', {}) for item in self.book.guide: if 'item' in item: chap = item.get('item') if chap: _href = chap.file_name _title = chap.title else: _href = item.get('href', '') _title = item.get('title', '') ref = etree.SubElement(guide, 'reference', {'type': item.get('type', ''), 'title': _title, 'href': _href}) tree_str = etree.tostring(root, pretty_print=True, encoding='utf-8', xml_declaration=True) self.out.writestr('%s/content.opf' % self.book.FOLDER_NAME, tree_str) def _get_nav(self, item): # just a basic navigation for now ncx = parse_string(self.book.get_template('nav')) root = ncx.getroot() root.set('lang', self.book.language) root.attrib['{%s}lang' % NAMESPACES['XML']] = self.book.language head = etree.SubElement(root, 'head') title = etree.SubElement(head, 'title') title.text = self.book.title # for now this just handles css files and ignores others for _link in item.links: _lnk = etree.SubElement(head, 'link', {"href":_link.get('href', ''), "rel":"stylesheet", "type":"text/css"}) body = etree.SubElement(root, 'body') nav = etree.SubElement(body, 'nav', {'{%s}type' % NAMESPACES['EPUB']: 'toc', 'id': 'id'}) content_title = etree.SubElement(nav, 'h2') content_title.text = self.book.title def _create_section(itm, items): ol = etree.SubElement(itm, 'ol') for item in items: if isinstance(item, tuple) or isinstance(item, list): li = etree.SubElement(ol, 'li') a = etree.SubElement(li, 'span') a.text = item[0].title _create_section(li, item[1]) elif isinstance(item, Link): li = etree.SubElement(ol, 'li') a = etree.SubElement(li, 'a', {'href': item.href}) a.text = item.title elif isinstance(item, EpubHtml): li = etree.SubElement(ol, 'li') a = etree.SubElement(li, 'a', {'href': item.file_name}) a.text = item.title _create_section(nav, self.book.toc) # LANDMARKS / GUIDE # - http://www.idpf.org/epub/30/spec/epub30-contentdocs.html#sec-xhtml-nav-def-types-landmarks if len(self.book.guide) > 0 and self.options.get('epub3_landmark'): guide_nav = etree.SubElement(body, 'nav', {'{%s}type' % NAMESPACES['EPUB']: 'landmarks'}) guide_content_title = etree.SubElement(guide_nav, 'h2') guide_content_title.text = self.options.get('landmark_title', 'Guide') guild_ol = etree.SubElement(guide_nav, 'ol') for elem in self.book.guide: li_item = etree.SubElement(guild_ol, 'li') if 'item' in elem: chap = elem.get('item', None) if chap: _href = chap.file_name _title = chap.title else: _href = elem.get('href', '') _title = elem.get('title', '') a_item = etree.SubElement(li_item, 'a', {'{%s}type' % NAMESPACES['EPUB']: elem.get('type', ''), 'href': _href}) a_item.text = _title tree_str = etree.tostring(root, pretty_print=True, encoding='utf-8', xml_declaration=True) return tree_str def _get_ncx(self): # we should be able to setup language for NCX as also ncx = parse_string(self.book.get_template('ncx')) root = ncx.getroot() head = etree.SubElement(root, 'head') # get this id uid = etree.SubElement(head, 'meta', {'content': self.book.uid, 'name': 'dtb:uid'}) uid = etree.SubElement(head, 'meta', {'content': '0', 'name': 'dtb:depth'}) uid = etree.SubElement(head, 'meta', {'content': '0', 'name': 'dtb:totalPageCount'}) uid = etree.SubElement(head, 'meta', {'content': '0', 'name': 'dtb:maxPageNumber'}) doc_title = etree.SubElement(root, 'docTitle') title = etree.SubElement(doc_title, 'text') title.text = self.book.title # doc_author = etree.SubElement(root, 'docAuthor') # author = etree.SubElement(doc_author, 'text') # author.text = 'Name of the person' # For now just make a very simple navMap nav_map = etree.SubElement(root, 'navMap') def _create_section(itm, items, uid): for item in items: if isinstance(item, tuple) or isinstance(item, list): section, subsection = item[0], item[1] np = etree.SubElement(itm, 'navPoint', {'id': 'sep_%d' % uid}) nl = etree.SubElement(np, 'navLabel') nt = etree.SubElement(nl, 'text') nt.text = section.title # CAN NOT HAVE EMPTY SRC HERE nc = etree.SubElement(np, 'content', {'src': ''}) #uid += 1 uid = _create_section(np, subsection, uid+1) elif isinstance(item, Link): _parent = itm _content = _parent.find('content') if _content != None: if _content.get('src') == '': _content.set('src', item.href) np = etree.SubElement(itm, 'navPoint', {'id': item.uid}) nl = etree.SubElement(np, 'navLabel') nt = etree.SubElement(nl, 'text') nt.text = item.title nc = etree.SubElement(np, 'content', {'src': item.href}) elif isinstance(item, EpubHtml): _parent = itm _content = _parent.find('content') if _content != None: if _content.get('src') == '': _content.set('src', item.file_name) np = etree.SubElement(itm, 'navPoint', {'id': item.get_id()}) nl = etree.SubElement(np, 'navLabel') nt = etree.SubElement(nl, 'text') nt.text = item.title nc = etree.SubElement(np, 'content', {'src': item.file_name}) return uid _create_section(nav_map, self.book.toc, 0) tree_str = etree.tostring(root, pretty_print=True, encoding='utf-8', xml_declaration=True) return tree_str def _write_items(self): for item in self.book.get_items(): if isinstance(item, EpubNcx): self.out.writestr('%s/%s' % (self.book.FOLDER_NAME, item.file_name), self._get_ncx()) elif isinstance(item, EpubNav): self.out.writestr('%s/%s' % (self.book.FOLDER_NAME, item.file_name), self._get_nav(item)) else: self.out.writestr('%s/%s' % (self.book.FOLDER_NAME, item.file_name), item.get_content()) def write(self): # check for the option allowZip64 self.out = zipfile.ZipFile(self.file_name, 'w', zipfile.ZIP_DEFLATED) self.out.writestr('mimetype', 'application/epub+zip', compress_type=zipfile.ZIP_STORED) self._write_container() self._write_opf_file() self._write_items() self.out.close() ########################################################################################################### class EpubReader(object): DEFAULT_OPTIONS = {} def __init__(self, epub_file_name, options = None): self.file_name = epub_file_name self.book = EpubBook() self.zf = None self.opf_file = '' self.opf_dir = '' self.options = dict(self.DEFAULT_OPTIONS) if options: self.options.update(options) def process(self): # should cache this html parsing so we don't do it for every plugin for plg in self.options.get('plugins', []): if hasattr(plg, 'after_read'): plg.after_read(self.book) for item in self.book.get_items(): if isinstance(item, EpubHtml): for plg in self.options.get('plugins', []): if hasattr(plg, 'html_after_read'): plg.html_after_read(self.book, item) def load(self): self._load() return self.book def read_file(self, name): # Raises KeyError return self.zf.read(name) def _load_container(self): meta_inf = self.read_file('META-INF/container.xml') tree = parse_string(meta_inf) for root_file in tree.findall('//xmlns:rootfile[@media-type]', namespaces = {'xmlns': NAMESPACES['CONTAINERNS']}): if root_file.get('media-type') == "application/oebps-package+xml": self.opf_file = root_file.get('full-path') self.opf_dir = os.path.dirname(self.opf_file) def _load_metadata(self): container_root = self.container.getroot() # get epub version self.book.version = container_root.get('version', None) # get unique-identifier if container_root.get('unique-identifier', None): self.book.IDENTIFIER_ID = container_root.get('unique-identifier') # get xml:lang # get metadata metadata = self.container.find('{%s}%s' % (NAMESPACES['OPF'], 'metadata')) nsmap = metadata.nsmap nstags = dict((k, '{%s}' % v) for k, v in six.iteritems(nsmap)) default_ns = nstags.get(None, '') nsdict = dict((v, {}) for v in nsmap.values()) def add_item(ns, tag, value, extra): if ns not in nsdict: nsdict[ns] = {} values = nsdict[ns].setdefault(tag, []) values.append((value, extra)) for t in metadata: if not etree.iselement(t): continue if t.tag == default_ns + 'meta': name = t.get('name') others = dict((k, v) for k, v in t.items()) if name and ':' in name: prefix, name = name.split(':', 1) else: prefix = None add_item(t.nsmap.get(prefix, prefix), name, t.text, others) else: tag = t.tag[t.tag.rfind('}') + 1:] if (t.prefix and t.prefix.lower() == 'dc') and tag == 'identifier': _id = t.get('id', None) if _id: self.book.IDENTIFIER_ID = _id others = dict((k, v) for k, v in t.items()) add_item(t.nsmap[t.prefix], tag, t.text, others) self.book.metadata = nsdict titles = self.book.get_metadata('DC', 'title') if len(titles) > 0: self.book.title = titles[0][0] for value, others in self.book.get_metadata("DC", "identifier"): if others.get("id") == self.book.IDENTIFIER_ID: self.book.uid = value def _load_manifest(self): for r in self.container.find('{%s}%s' % (NAMESPACES['OPF'], 'manifest')): if r is not None and r.tag != '{%s}item' % NAMESPACES['OPF']: continue media_type = r.get('media-type') _properties = r.get('properties', '') if _properties: properties = _properties.split(' ') else: properties = [] # people use wrong content types if media_type == 'image/jpg': media_type = 'image/jpeg' if media_type == 'application/x-dtbncx+xml': ei = EpubNcx(uid=r.get('id'), file_name=unquote(r.get('href'))) ei.content = self.read_file(os.path.join(self.opf_dir, ei.file_name)) elif media_type == 'application/xhtml+xml': if 'nav' in properties: ei = EpubNav(uid=r.get('id'), file_name=unquote(r.get('href'))) ei.content = self.read_file(os.path.join(self.opf_dir, r.get('href'))) elif 'cover' in properties: ei = EpubCoverHtml() ei.content = self.read_file(os.path.join(self.opf_dir, unquote(r.get('href')))) else: ei = EpubHtml() ei.id = r.get('id') ei.file_name = unquote(r.get('href')) ei.media_type = media_type ei.content = self.read_file(os.path.join(self.opf_dir, ei.get_name())) ei.properties = properties elif media_type in IMAGE_MEDIA_TYPES: if 'cover-image' in properties: ei = EpubCover(uid=r.get('id'), file_name=unquote(r.get('href'))) ei.media_type = media_type ei.content = self.read_file(os.path.join(self.opf_dir, ei.get_name())) else: ei = EpubImage() ei.id = r.get('id') ei.file_name = unquote(r.get('href')) ei.media_type = media_type ei.content = self.read_file(os.path.join(self.opf_dir, ei.get_name())) else: # different types ei = EpubItem() ei.id = r.get('id') ei.file_name = unquote(r.get('href')) ei.media_type = media_type ei.content = self.read_file(os.path.join(self.opf_dir, ei.get_name())) # r.get('properties') self.book.add_item(ei) def _parse_ncx(self, data): tree = parse_string(data); tree_root = tree.getroot() nav_map = tree_root.find('{%s}navMap' % NAMESPACES['DAISY']) def _get_children(elems, n, nid): label, content = '', '' children = [] _id = '' for a in elems.getchildren(): if a.tag == '{%s}navLabel' % NAMESPACES['DAISY']: label = a.getchildren()[0].text if a.tag == '{%s}content' % NAMESPACES['DAISY']: content = a.get('src') if a.tag == '{%s}navPoint' % NAMESPACES['DAISY']: children.append(_get_children(a, n+1, a.get('id', ''))) if len(children) > 0: if n == 0: return children return (Section(label), children) else: return (Link(content, label, nid)) self.book.toc = _get_children(nav_map, 0, '') def _parse_nav(self, data, base_path): html_node = parse_html_string(data) nav_node = html_node.xpath("//nav[@*='toc']")[0] def parse_list(list_node): items = [] for item_node in list_node.findall("li"): sublist_node = item_node.find("ol") link_node = item_node.find("a") if sublist_node is not None: title = item_node[0].text children = parse_list(sublist_node) items.append((Section(title), children)) elif link_node is not None: title = link_node.text href = os.path.normpath(os.path.join(base_path, link_node.get("href"))) items.append(Link(href, title)) return items self.book.toc = parse_list(nav_node.find("ol")) def _load_spine(self): spine = self.container.find('{%s}%s' % (NAMESPACES['OPF'], 'spine')) self.book.spine = [(t.get('idref'), t.get('linear', 'yes')) for t in spine] toc = spine.get('toc', '') # should read ncx or nav file if toc: try: ncxFile = self.read_file(os.path.join(self.opf_dir, self.book.get_item_with_id(toc).get_name())) except KeyError: raise EpubError(-1, 'Can not find ncx file.') self._parse_ncx(ncxFile) def _load_guide(self): guide = self.container.find('{%s}%s' % (NAMESPACES['OPF'], 'guide')) if guide is not None: self.book.guide = [{'href': t.get('href'), 'title': t.get('title'), 'type': t.get('type')} for t in guide] def _load_opf_file(self): try: s = self.read_file(self.opf_file) except KeyError: raise EpubError(-1, 'Can not find container file') self.container = parse_string(s) self._load_metadata() self._load_manifest() self._load_spine() self._load_guide() # read nav file if found # if not self.book.toc: nav_item = next((item for item in self.book.items if isinstance(item, EpubNav)), None) if nav_item: self._parse_nav(nav_item.content, os.path.dirname(nav_item.file_name)) def _load(self): try: self.zf = zipfile.ZipFile(self.file_name, 'r', compression = zipfile.ZIP_DEFLATED, allowZip64 = True) except zipfile.BadZipfile as bz: raise EpubException(0, 'Bad Zip file') except zipfile.LargeZipFile as bz: raise EpubException(1, 'Large Zip file') # 1st check metadata self._load_container() self._load_opf_file() self.zf.close() ## WRITE def write_epub(name, book, options = None): epub = EpubWriter(name, book, options) epub.process() try: epub.write() except IOError: pass ## READ def read_epub(name, options = None): reader = EpubReader(name, options) book = reader.load() reader.process() return book python-ebooklib-0.15~ds0.orig/ebooklib/__init__.py0000644000175000017500000000254512326461175022104 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . # Version of ebook library VERSION = (0, 15, 0) # LIST OF POSSIBLE ITEMS ITEM_UNKNOWN = 0 ITEM_IMAGE = 1 ITEM_STYLE = 2 ITEM_SCRIPT = 3 ITEM_NAVIGATION = 4 ITEM_VECTOR = 5 ITEM_FONT = 6 ITEM_VIDEO = 7 ITEM_AUDIO = 8 ITEM_DOCUMENT = 9 # EXTENSION MAPPER EXTENSIONS = {ITEM_IMAGE: ['.jpg', '.jpeg', '.gif', '.tiff', '.tif', '.png'], ITEM_STYLE: ['.css'], ITEM_VECTOR: ['.svg'], ITEM_FONT: ['.otf', '.woff'], ITEM_SCRIPT: ['.js'], ITEM_NAVIGATION: ['.ncx'], ITEM_VIDEO: ['.mov', '.mp4', '.avi'], ITEM_AUDIO: ['.mp3', '.ogg'] } python-ebooklib-0.15~ds0.orig/ebooklib/plugins/0000700000175000017500000000000012326462732021434 5ustar alessioalessiopython-ebooklib-0.15~ds0.orig/ebooklib/plugins/sourcecode.py0000644000175000017500000000466112326461175024162 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . from ebooklib.plugins.base import BasePlugin from ebooklib.utils import parse_html_string class SourceHighlighter(BasePlugin): def __init__(self): pass def html_before_write(self, book, chapter): from lxml import etree, html from pygments import highlight from pygments.formatters import HtmlFormatter from ebooklib import epub try: tree = parse_html_string(chapter.content) except: return root = tree.getroottree() had_source = False if len(root.find('body')) != 0: body = tree.find('body') # check for embeded source for source in body.xpath('//pre[contains(@class,"source-")]'): css_class = source.get('class') source_text = (source.text or '') + ''.join([html.tostring(child) for child in source.iterchildren()]) if 'source-python' in css_class: from pygments.lexers import PythonLexer # _text = highlight(source_text, PythonLexer(), HtmlFormatter(linenos="inline")) _text = highlight(source_text, PythonLexer(), HtmlFormatter()) if 'source-css' in css_class: from pygments.lexers import CssLexer _text = highlight(source_text, CssLexer(), HtmlFormatter()) _parent = source.getparent() _parent.replace(source, etree.XML(_text)) had_source = True if had_source: chapter.add_link(href="style/code.css", rel="stylesheet", type="text/css") chapter.content = etree.tostring(tree, pretty_print=True, encoding='utf-8') python-ebooklib-0.15~ds0.orig/ebooklib/plugins/tidyhtml.py0000644000175000017500000000430212326461175023655 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . import six import subprocess from ebooklib.plugins.base import BasePlugin from ebooklib.utils import parse_html_string # Recommend usage of # - https://github.com/w3c/tidy-html5 def tidy_cleanup(content, **extra): cmd = [] for k, v in six.iteritems(extra): cmd.append('--%s' % k) if v: cmd.append(v) # must parse all other extra arguments try: p = subprocess.Popen(['tidy']+cmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) except OSError: return (3, None) p.stdin.write(content) (cont, p_err) = p.communicate() # 0 - all ok # 1 - there were warnings # 2 - there were errors # 3 - exception return (p.returncode, cont) class TidyPlugin(BasePlugin): NAME = 'Tidy HTML' OPTIONS = {'utf8': None, 'tidy-mark': 'no' } def __init__(self, extra = {}): self.options = dict(self.OPTIONS) self.options.update(extra) def html_before_write(self, book, chapter): if not chapter.content: return None (_, chapter.content) = tidy_cleanup(chapter.content, **self.options) return chapter.content def html_after_read(self, book, chapter): if not chapter.content: return None (_, chapter.content) = tidy_cleanup(chapter.content, **self.options) return chapter.content python-ebooklib-0.15~ds0.orig/ebooklib/plugins/base.py0000644000175000017500000000301212326461175022726 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . class BasePlugin(object): def before_write(self, book): "Processing before save" return True def after_write(self, book): "Processing after save" return True def before_read(self, book): "Processing before save" return True def after_read(self, book): "Processing after save" return True def item_after_read(self, book, item): "Process general item after read." return True def item_before_write(self, book, item): "Process general item before write." return True def html_after_read(self, book, chapter): "Processing HTML before read." return True def html_before_write(self, book, chapter): "Processing HTML before save." return True python-ebooklib-0.15~ds0.orig/ebooklib/plugins/__init__.py0000644000175000017500000000000012326461175023545 0ustar alessioalessiopython-ebooklib-0.15~ds0.orig/ebooklib/plugins/booktype.py0000644000175000017500000001062712326461175023662 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . from ebooklib.plugins.base import BasePlugin from ebooklib.utils import parse_html_string class BooktypeLinks(BasePlugin): NAME = 'Booktype Links' def __init__(self, booktype_book): self.booktype_book = booktype_book def html_before_write(self, book, chapter): from lxml import etree try: from urlparse import urlparse, urljoin except ImportError: from urllib.parse import urlparse, urljoin try: tree = parse_html_string(chapter.content) except: return root = tree.getroottree() if len(root.find('body')) != 0: body = tree.find('body') # should also be aware to handle # ../chapter/ # ../chapter/#reference # ../chapter#reference for _link in body.xpath('//a'): # This is just temporary for the footnotes if _link.get('href', '').find('InsertNoteID') != -1: _ln = _link.get('href', '') i = _ln.find('#') _link.set('href', _ln[i:]); continue _u = urlparse(_link.get('href', '')) # Let us care only for internal links at the moment if _u.scheme == '': if _u.path != '': _link.set('href', '%s.xhtml' % _u.path) if _u.fragment != '': _link.set('href', urljoin(_link.get('href'), '#%s' % _u.fragment)) if _link.get('name') != None: _link.set('id', _link.get('name')) etree.strip_attributes(_link, 'name') chapter.content = etree.tostring(tree, pretty_print=True, encoding='utf-8') class BooktypeFootnotes(BasePlugin): NAME = 'Booktype Footnotes' def __init__(self, booktype_book): self.booktype_book = booktype_book def html_before_write(self, book, chapter): from lxml import etree from ebooklib import epub try: tree = parse_html_string(chapter.content) except: return root = tree.getroottree() if len(root.find('body')) != 0: body = tree.find('body') # 1 #
  1. prvi footnote ^
  2. # 1

    # for footnote in body.xpath('//span[@class="InsertNoteMarker"]'): footnote_id = footnote.get('id')[:-8] a = footnote.getchildren()[0].getchildren()[0] footnote_text = body.xpath('//li[@id="%s"]' % footnote_id)[0] a.attrib['{%s}type' % epub.NAMESPACES['EPUB']] = 'noteref' ftn = etree.SubElement(body, 'aside', {'id': footnote_id}) ftn.attrib['{%s}type' % epub.NAMESPACES['EPUB']] = 'footnote' ftn_p = etree.SubElement(ftn, 'p') ftn_p.text = footnote_text.text old_footnote = body.xpath('//ol[@id="InsertNote_NoteList"]') if len(old_footnote) > 0: body.remove(old_footnote[0]) chapter.content = etree.tostring(tree, pretty_print=True, encoding='utf-8') python-ebooklib-0.15~ds0.orig/ebooklib/plugins/standard.py0000644000175000017500000003033412326461175023623 0ustar alessioalessio# This file is part of EbookLib. # Copyright (c) 2013 Aleksandar Erkalovic # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . import six from ebooklib.plugins.base import BasePlugin from ebooklib.utils import parse_html_string # TODO: # - should also look for the _required_ elements # http://www.w3.org/html/wg/drafts/html/master/tabular-data.html#the-table-element ATTRIBUTES_GLOBAL = ['accesskey', 'class', 'contenteditable', 'contextmenu', 'dir', 'draggable', 'dropzone', 'hidden', 'id', 'inert', 'itemid', 'itemprop', 'itemref', 'itemscope', 'itemtype', 'lang', 'spellcheck', 'style', 'tabindex', 'title', 'translate', 'epub:type'] DEPRECATED_TAGS = ['acronym', 'applet', 'basefont', 'big', 'center', 'dir', 'font', 'frame', 'frameset', 'isindex', 'noframes', 's', 'strike', 'tt', 'u'] def leave_only(item, tag_list): for _attr in six.iterkeys(item.attrib): if _attr not in tag_list: del item.attrib[_attr] class SyntaxPlugin(BasePlugin): NAME = 'Check HTML syntax' def html_before_write(self, book, chapter): from lxml import etree try: tree = parse_html_string(chapter.content) except: return root = tree.getroottree() # delete deprecated tags # i should really have a list of allowed tags for tag in DEPRECATED_TAGS: etree.strip_tags(root, tag) head = tree.find('head') if head is not None and len(head) != 0: for _item in head: if _item.tag == 'base': leave_only(_item, ATTRIBUTES_GLOBAL + ['href', 'target']) elif _item.tag == 'link': leave_only(_item, ATTRIBUTES_GLOBAL + ['href', 'crossorigin', 'rel', 'media', 'hreflang', 'type', 'sizes']) elif _item.tag == 'title': if _item.text == '': head.remove(_item) elif _item.tag == 'meta': leave_only(_item, ATTRIBUTES_GLOBAL + ['name', 'http-equiv', 'content', 'charset']) # just remove for now, but really should not be like this head.remove(_item) elif _item.tag == 'script': leave_only(_item, ATTRIBUTES_GLOBAL + ['src', 'type', 'charset', 'async', 'defer', 'crossorigin']) elif _item.tag == 'source': leave_only(_item, ATTRIBUTES_GLOBAL + ['src', 'type', 'media']) elif _item.tag == 'style': leave_only(_item, ATTRIBUTES_GLOBAL + ['media', 'type', 'scoped']) else: leave_only(_item, ATTRIBUTES_GLOBAL) if len(root.find('body')) != 0: body = tree.find('body') for _item in body.iter(): # it is not # if _item.tag == 'a': leave_only(_item, ATTRIBUTES_GLOBAL + ['href', 'target', 'download', 'rel', 'hreflang', 'type']) elif _item.tag == 'area': leave_only(_item, ATTRIBUTES_GLOBAL + ['alt', 'coords', 'shape', 'href', 'target', 'download', 'rel', 'hreflang', 'type']) elif _item.tag == 'audio': leave_only(_item, ATTRIBUTES_GLOBAL + ['src', 'crossorigin', 'preload', 'autoplay', 'mediagroup', 'loop', 'muted', 'controls']) elif _item.tag == 'blockquote': leave_only(_item, ATTRIBUTES_GLOBAL + ['cite']) elif _item.tag == 'button': leave_only(_item, ATTRIBUTES_GLOBAL + ['autofocus', 'disabled', 'form', 'formaction', 'formenctype', 'formmethod', 'formnovalidate', 'formtarget', 'name', 'type', 'value', 'menu']) elif _item.tag == 'canvas': leave_only(_item, ATTRIBUTES_GLOBAL + ['width', 'height']) elif _item.tag == 'canvas': leave_only(_item, ATTRIBUTES_GLOBAL + ['width', 'height']) elif _item.tag == 'del': leave_only(_item, ATTRIBUTES_GLOBAL + ['cite', 'datetime']) elif _item.tag == 'details': leave_only(_item, ATTRIBUTES_GLOBAL + ['open']) elif _item.tag == 'embed': leave_only(_item, ATTRIBUTES_GLOBAL + ['src', 'type', 'width', 'height']) elif _item.tag == 'fieldset': leave_only(_item, ATTRIBUTES_GLOBAL + ['disable', 'form', 'name']) elif _item.tag == 'details': leave_only(_item, ATTRIBUTES_GLOBAL + ['accept-charset', 'action', 'autocomplete', 'enctype', 'method', 'name', 'novalidate', 'target']) elif _item.tag == 'iframe': leave_only(_item, ATTRIBUTES_GLOBAL + ['src', 'srcdoc', 'name', 'sandbox', 'seamless', 'allowfullscreen', 'width', 'height']) elif _item.tag == 'img': _src = _item.get('src', '').lower() if _src.startswith('http://') or _src.startswith('https://'): if 'remote-resources' not in chapter.properties: chapter.properties.append('remote-resources') # THIS DOES NOT WORK, ONLY VIDEO AND AUDIO FILES CAN BE REMOTE RESOURCES # THAT MEANS I SHOULD ALSO CATCH # # EbookLib is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # EbookLib is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with EbookLib. If not, see . import io from lxml import etree def debug(obj): import pprint pp = pprint.PrettyPrinter(indent=4) pp.pprint(obj) def parse_string(s): try: tree = etree.parse(io.BytesIO(s.encode('utf-8'))) except: tree = etree.parse(io.BytesIO(s)) return tree def parse_html_string(s): from lxml import html utf8_parser = html.HTMLParser(encoding='utf-8') html_tree = html.document_fromstring(s , parser=utf8_parser) return html_tree python-ebooklib-0.15~ds0.orig/LICENSE.txt0000644000175000017500000010333012326461175020022 0ustar alessioalessio GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU Affero General Public License is a free, copyleft license for software and other kinds of works, specifically designed to ensure cooperation with the community in the case of network server software. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, our General Public Licenses are intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. Developers that use our General Public Licenses protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License which gives you legal permission to copy, distribute and/or modify the software. A secondary benefit of defending all users' freedom is that improvements made in alternate versions of the program, if they receive widespread use, become available for other developers to incorporate. Many developers of free software are heartened and encouraged by the resulting cooperation. However, in the case of software used on network servers, this result may fail to come about. The GNU General Public License permits making a modified version and letting the public access it on a server without ever releasing its source code to the public. The GNU Affero General Public License is designed specifically to ensure that, in such cases, the modified source code becomes available to the community. It requires the operator of a network server to provide the source code of the modified version running there to the users of that server. Therefore, public use of a modified version, on a publicly accessible server, gives the public access to the source code of the modified version. An older license, called the Affero General Public License and published by Affero, was designed to accomplish similar goals. This is a different license, not a version of the Affero GPL, but Affero has released a new version of the Affero GPL which permits relicensing under this license. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Remote Network Interaction; Use with the GNU General Public License. Notwithstanding any other provision of this License, if you modify the Program, your modified version must prominently offer all users interacting with it remotely through a computer network (if your version supports such interaction) an opportunity to receive the Corresponding Source of your version by providing access to the Corresponding Source from a network server at no charge, through some standard or customary means of facilitating copying of software. This Corresponding Source shall include the Corresponding Source for any work covered by version 3 of the GNU General Public License that is incorporated pursuant to the following paragraph. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU Affero General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU Affero General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU Affero General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU Affero General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If your software can interact with users remotely through a computer network, you should also make sure that it provides a way for users to get its source. For example, if your program is a web application, its interface could display a "Source" link that leads users to an archive of the code. There are many ways you could offer source, and different solutions will be better for different programs; see section 13 for the specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see . python-ebooklib-0.15~ds0.orig/setup.py0000644000175000017500000000160512326461175017713 0ustar alessioalessio#from distutils.core import setup from setuptools import setup setup( name = 'EbookLib', version = '0.15', author = 'Aleksandar Erkalovic', author_email = 'aerkalov@gmail.com', packages = ['ebooklib', 'ebooklib.plugins'], url = 'https://github.com/aerkalov/ebooklib', license = 'GNU Affero General Public License', description = 'Ebook library which can handle EPUB2/EPUB3 and Kindle format', long_description = open('README.md').read(), keywords = ['ebook', 'epub', 'kindle'], classifiers = [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Topic :: Software Development :: Libraries :: Python Modules" ], install_requires = [ "lxml", "six" ] )