mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make AnchorLocation mutable
This commit is contained in:
parent
4a362c31b0
commit
6a56d253dc
@ -9,7 +9,6 @@ import copy
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
from collections import namedtuple
|
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
@ -364,7 +363,16 @@ def make_anchors_unique(container):
|
|||||||
return name_anchor_map
|
return name_anchor_map
|
||||||
|
|
||||||
|
|
||||||
AnchorLocation = namedtuple('AnchorLocation', 'pagenum left top zoom')
|
class AnchorLocation(object):
|
||||||
|
|
||||||
|
__slots__ = ('pagenum', 'left', 'top', 'zoom')
|
||||||
|
|
||||||
|
def __init__(self, pagenum=1, left=0, top=0, zoom=0):
|
||||||
|
self.pagenum, self.left, self.top, self.zoom = pagenum, left, top, zoom
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return 'AnchorLocation(pagenum={}, left={}, top={}, zoom={})'.format(
|
||||||
|
self.pagenum, self.left, self.top, self.zoom)
|
||||||
|
|
||||||
|
|
||||||
def get_anchor_locations(pdf_doc, first_page_num, toc_uuid):
|
def get_anchor_locations(pdf_doc, first_page_num, toc_uuid):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user