__init__
PYL-W0201304 del self.cache
305
306 def _save_response(self, arg):
307 self.response = None308 if arg:
309 raw_response = arg
310 self.response = pickle.loads(raw_response)
307 self.response = None
308 if arg:
309 raw_response = arg
310 self.response = pickle.loads(raw_response)311
312 def send_request(self, request_type, **kwargs):
313 request = {}
295 database_class = TimeSeriesDatabase.plugins[database]
296 state.database = database_class(settings)
297
298 settings.CACHE_SIZE_LOW_WATERMARK = settings.MAX_CACHE_SIZE * 0.95299
300 if "action" not in self:
301 self["action"] = "start"
76 carbon_sock.bind((self.interface, self.port))
77
78 if hasattr(self.protocol, 'datagramReceived'):
79 self._port = reactor.adoptDatagramPort( 80 carbon_sock.fileno(), socket.AF_INET, self.protocol())
81 else:
82 carbon_sock.listen(tmp_port.backlog)
80 carbon_sock.fileno(), socket.AF_INET, self.protocol())
81 else:
82 carbon_sock.listen(tmp_port.backlog)
83 self._port = reactor.adoptStreamPort( 84 carbon_sock.fileno(), socket.AF_INET, self.factory)
85 state.listeningPorts.append(self._port)
86 self._port.paused = False
Defining an instance attribute outside __init__
affects the readability of code. It is expected to find all the attributes an instance may have by reading its __init__
method. If there is a need to initialize attribute via sub-initialization methods, it is recommended to assign attributes to None
in the init then call the sub-initialization methods.