MCPcopy
hub / github.com/Gallopsled/pwntools / get

Function get

pwnlib/term/windows_termcap.py:11–28  ·  view source on GitHub ↗
(cap, *args, **kwargs)

Source from the content-addressed store, hash-verified

9cache = None
10
11def get(cap, *args, **kwargs):
12 default = kwargs.pop('default', '')
13
14 if 'PWNLIB_NOTERM' in os.environ:
15 return default
16
17 if kwargs != {}:
18 raise TypeError("get(): No such argument %r" % kwargs.popitem()[0])
19
20 if cache is None:
21 init()
22
23 s = cache.get(cap)
24 if s:
25 if args:
26 return s(*args)
27 return s
28 return default
29
30def init():
31 global cache

Callers

nothing calls this directly

Calls 3

initFunction · 0.70
popMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected