Fix #812750 (Literati (aka Azbooka) does not detect SD Card)

This commit is contained in:
Kovid Goyal 2011-07-19 07:05:05 -06:00
parent a389b310c6
commit 1b136b6fec
2 changed files with 19 additions and 1 deletions

View File

@ -131,7 +131,7 @@ class AZBOOKA(ALEX):
description = _('Communicate with the Azbooka')
VENDOR_NAME = 'LINUX'
WINDOWS_MAIN_MEM = 'FILE-STOR_GADGET'
WINDOWS_MAIN_MEM = WINDOWS_CARD_A_MEM = 'FILE-STOR_GADGET'
MAIN_MEMORY_VOLUME_LABEL = 'Azbooka Internal Memory'

View File

@ -574,6 +574,13 @@ class Tag(object): # {{{
class IndexEntry(object): # {{{
'''
The index is made up of entries, each of which is represented by an
instance of this class. Index entries typically point to offsets int eh
HTML, specify HTML sizes and point to text strings in the CNCX that are
used in the navigation UI.
'''
TYPES = {
# Present in book type files
0x0f : 'chapter',
@ -619,6 +626,11 @@ class IndexEntry(object): # {{{
class IndexRecord(object): # {{{
'''
Represents all indexing information in the MOBI, apart from indexing info
in the trailing data of the text records.
'''
def __init__(self, record, index_header, cncx):
self.record = record
raw = self.record.raw
@ -684,6 +696,12 @@ class IndexRecord(object): # {{{
class CNCX(object) : # {{{
'''
Parses the records that contain the compiled NCX (all strings from the
NCX). Presents a simple offset : string mapping interface to access the
data.
'''
def __init__(self, records, codec):
self.records = OrderedDict()
pos = 0