Skip to content

Commit

Permalink
src/__init__.py: class Archive: fix _add_treeitem() in rebased implem…
Browse files Browse the repository at this point in the history
…entation.

Used to rely on non-existent JM_last_tree(), but now implemented more simply
without it.
  • Loading branch information
julian-smith-artifex-com committed Dec 12, 2023
1 parent c063bfe commit fe176dc
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions src/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,15 +1601,10 @@ def _add_dir( self, folder, path=None):
mupdf.fz_mount_multi_archive( self.this, sub, path)

def _add_treeitem( self, memory, name, path=None):
drop_sub = False
buff = JM_BufferFromBytes( memory)
sub = JM_last_tree( self.this, path)
if not sub:
sub = mupdf.fz_new_tree_archive( None)
drop_sub = True
sub = mupdf.fz_new_tree_archive( mupdf.FzTree())
mupdf.fz_tree_archive_add_buffer( sub, name, buff)
if drop_sub:
mupdf.fz_mount_multi_archive( self.this, sub, path)
mupdf.fz_mount_multi_archive( self.this, sub, path)

def _add_ziptarfile( self, filepath, type_, path=None):
if type_ == 1:
Expand Down Expand Up @@ -16203,13 +16198,6 @@ def JM_is_jbig2_image(dict_):
# return 1;
#return 0;

def JM_last_tree(arch, mount):
'''
Return last archive if it is a tree and mount points match
'''
assert 0, 'Not implemented'


def JM_listbox_value( annot):
'''
ListBox retrieve value
Expand Down

0 comments on commit fe176dc

Please sign in to comment.