MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / ve_maker

Function ve_maker

src_classic/utils.py:4586–4602  ·  view source on GitHub ↗
(ve)

Source from the content-addressed store, hash-verified

4584 all_ocgs = set(doc.get_ocgs().keys())
4585
4586 def ve_maker(ve):
4587 if type(ve) not in (list, tuple) or len(ve) < 2:
4588 raise ValueError("bad 've' format: %s" % ve)
4589 if ve[0].lower() not in ("and", "or", "not"):
4590 raise ValueError("bad operand: %s" % ve[0])
4591 if ve[0].lower() == "not" and len(ve) != 2:
4592 raise ValueError("bad 've' format: %s" % ve)
4593 item = "[/%s" % ve[0].title()
4594 for x in ve[1:]:
4595 if type(x) is int:
4596 if x not in all_ocgs:
4597 raise ValueError("bad OCG %i" % x)
4598 item += " %i 0 R" % x
4599 else:
4600 item += " %s" % ve_maker(x)
4601 item += "]"
4602 return item
4603
4604 text = "<</Type/OCMD"
4605

Callers 3

ve_makerMethod · 0.85
set_ocmdMethod · 0.85
set_ocmdFunction · 0.85

Calls 1

titleMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…