mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
version 0.4.22
This commit is contained in:
parent
a6e884a53e
commit
6beccec843
@ -13,7 +13,7 @@
|
|||||||
## with this program; if not, write to the Free Software Foundation, Inc.,
|
## with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
''' E-book management software'''
|
''' E-book management software'''
|
||||||
__version__ = "0.4.21"
|
__version__ = "0.4.22"
|
||||||
__docformat__ = "epytext"
|
__docformat__ = "epytext"
|
||||||
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
__author__ = "Kovid Goyal <kovid@kovidgoyal.net>"
|
||||||
__appname__ = 'libprs500'
|
__appname__ = 'libprs500'
|
||||||
|
@ -191,7 +191,6 @@ class BookList(_BookList):
|
|||||||
""" Add a node into the DOM tree, representing a book """
|
""" Add a node into the DOM tree, representing a book """
|
||||||
book = self.book_by_path(name)
|
book = self.book_by_path(name)
|
||||||
if book is not None:
|
if book is not None:
|
||||||
print name
|
|
||||||
self.remove_book(name)
|
self.remove_book(name)
|
||||||
|
|
||||||
node = self.document.createElement(self.prefix + "text")
|
node = self.document.createElement(self.prefix + "text")
|
||||||
|
@ -62,7 +62,6 @@ def process_file(path, options, logger=None):
|
|||||||
path = opf[0]
|
path = opf[0]
|
||||||
opf = OPFReader(path)
|
opf = OPFReader(path)
|
||||||
htmlfile = opf.spine.items().next().href
|
htmlfile = opf.spine.items().next().href
|
||||||
print htmlfile
|
|
||||||
options.opf = path
|
options.opf = path
|
||||||
else:
|
else:
|
||||||
l = glob.glob(os.path.join(tdir, '*toc*.htm*'))
|
l = glob.glob(os.path.join(tdir, '*toc*.htm*'))
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
from libprs500.ebooks.lrf import entity_to_unicode
|
from libprs500.ebooks.lrf import entity_to_unicode
|
||||||
import struct, array, zlib, cStringIO, collections, re
|
import struct, array, zlib, cStringIO, collections, re
|
||||||
from htmlentitydefs import name2codepoint
|
|
||||||
|
|
||||||
from libprs500.ebooks.lrf import LRFParseError
|
from libprs500.ebooks.lrf import LRFParseError
|
||||||
from libprs500.ebooks.lrf.tags import Tag
|
from libprs500.ebooks.lrf.tags import Tag
|
||||||
@ -310,7 +309,6 @@ class Locate(EmptyPageElement):
|
|||||||
pos_map = {1:'bottomleft', 2:'bottomright',3:'topright',4:'topleft', 5:'base'}
|
pos_map = {1:'bottomleft', 2:'bottomright',3:'topright',4:'topleft', 5:'base'}
|
||||||
|
|
||||||
def __init__(self, pos):
|
def __init__(self, pos):
|
||||||
print pos
|
|
||||||
self.pos = self.pos_map[pos]
|
self.pos = self.pos_map[pos]
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
#!/usr/bin/python
|
|
||||||
|
|
||||||
#Read text streams from LRF files. Usage ./stream.py <myfile.lrf> <offset to beginning of stream object in hex>
|
|
||||||
|
|
||||||
import array, sys, struct, zlib
|
|
||||||
|
|
||||||
def descrambleBuf(buf, l, xorKey):
|
|
||||||
i = 0
|
|
||||||
a = array.array('B',buf)
|
|
||||||
while l>0:
|
|
||||||
a[i] ^= xorKey
|
|
||||||
i+=1
|
|
||||||
l-=1
|
|
||||||
return a.tostring()
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
f = open(sys.argv[1], 'rb')
|
|
||||||
f.seek(0x0a)
|
|
||||||
xorkey = struct.unpack('<H', f.read(2))[0]
|
|
||||||
|
|
||||||
f.seek(int(sys.argv[2], 16) + 0x10)
|
|
||||||
flags = struct.unpack('<H', f.read(2))[0]
|
|
||||||
f.read(2)
|
|
||||||
l = struct.unpack('<I', f.read(4))[0]
|
|
||||||
f.read(2)
|
|
||||||
raw = f.read(l)
|
|
||||||
key = (l % xorkey) + 0x0f
|
|
||||||
descrambled = descrambleBuf(raw, l, key) if (flags & 0x200) else raw
|
|
||||||
stream = zlib.decompress(descrambled[4:]) if (flags & 0x100) else descrambled
|
|
||||||
print stream
|
|
Loading…
x
Reference in New Issue
Block a user