class _Base(Thread): def __init__(self): log("(Media) Staring thread") self._request = Json() super(_Base, self).__init__(target=self._run) def is_done(self, wait=0): time.sleep(wait) return self.stop.is_set() def _handle_param(self, **param): try: return self._request.request(**param) except TypeError: return self._request.request_proxy(**param) def close(self): super(_Base, self).close() self._request.close()
def __init__(self): log("(Media) Staring thread") self._request = Json() super(_Base, self).__init__(target=self._run)