INNER CODE UNIT · Python
query
siznax/wptools · wptools/core.py:241
def query(self, action=None):
"""
returns cached query string (without &format=json) for given action,
or list of cached actions
"""
if action in self.cache:
return self.cache[action]['query'].replace('&format=json', '')
return self.cache.keys() or None
def response(self, action=None):
"""
returns cached response (as dict) for given action,
or list of cached actions
"""
if action in self.cache:
return self.cache[action]['response']
return self.cache.keys() or None