def txt_exists(self): result = endpoint.PageEp(document_ep=self.document.doc_ep, page_num=self.number, page_count=self.page_count) return result.txt_exists()
def page_eps(self): """ Enables document instance to get quickly page endpoints: page_ep = doc.page_eps[2] page_ep.url() # local url to second page of the doc. This is shortcut method when most used Step(1) is required. """ results = [None] # indexing starts from 1 # doc.page_count might be wrong because per # page logic was added just recently. So, let's use # this opportunity and correct it! page_count = get_pagecount(self.doc_ep.url()) if page_count != self.page_count: self.page_count = page_count self.save() for page_num in range(1, page_count + 1): ep = endpoint.PageEp(document_ep=self.doc_ep, page_num=page_num, step=step.Step(1), page_count=self.page_count) results.append(ep) return results
def get_page_ep(self, page_num, step): """ For Step(1) shortcut, use doc_instance.page_eps property. """ return endpoint.PageEp(document_ep=self.doc_ep, page_num=page_num, step=step, page_count=self.page_count)
def page_ep(self): return endpoint.PageEp(document_ep=self.document.doc_ep, page_num=self.number, page_count=self.page_count)