MCPcopy Index your code
hub / github.com/clips/pattern / do_keyword

Method do_keyword

pattern/web/pdf/pdfinterp.py:276–294  ·  view source on GitHub ↗
(self, pos, token)

Source from the content-addressed store, hash-verified

274 KEYWORD_ID = KWD('ID')
275 KEYWORD_EI = KWD('EI')
276 def do_keyword(self, pos, token):
277 if token is self.KEYWORD_BI:
278 # inline image within a content stream
279 self.start_type(pos, 'inline')
280 elif token is self.KEYWORD_ID:
281 try:
282 (_, objs) = self.end_type('inline')
283 if len(objs) % 2 != 0:
284 raise PSTypeError('Invalid dictionary construct: %r' % objs)
285 d = dict( (literal_name(k), v) for (k,v) in choplist(2, objs) )
286 (pos, data) = self.get_inline_data(pos+len('ID '))
287 obj = PDFStream(d, data)
288 self.push((pos, obj))
289 self.push((pos, self.KEYWORD_EI))
290 except PSTypeError:
291 if STRICT: raise
292 else:
293 self.push((pos, token))
294 return
295
296
297## Interpreter

Callers

nothing calls this directly

Calls 9

get_inline_dataMethod · 0.95
PSTypeErrorClass · 0.90
literal_nameFunction · 0.90
choplistFunction · 0.90
PDFStreamClass · 0.90
lenFunction · 0.85
start_typeMethod · 0.80
end_typeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected