Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def send_manager(self, process_name, type, data, **kwargs):
self.manager.events.put(Message(type=type,
data=data,
time=datetime.datetime.now(),
name=process_name,
colour=None))
def fake_message(data, **kwargs):
defaults = {
'type': 'line',
'data': data,
'time': datetime.datetime(2012, 8, 11, 12, 42),
'name': None,
'colour': None,
}
defaults.update(kwargs)
return Message(**defaults)
def _system_print(self, data):
self._printer.write(Message(type='line',
data=data,
time=self._env.now(),
name=SYSTEM_PRINTER_NAME,
colour=None))
def _send_message(self, data, type='line'):
if self._events is not None:
self._events.put(Message(type=type,
data=data,
time=self._env.now(),
name=self.name,
colour=self.colour))