platypush/message/event/__init__.py
def build(cls, msg):
        """ Builds an event message from a JSON UTF-8 string/bytearray, a
        dictionary, or another Event """

        msg = super().parse(msg)
        event_type = msg['args'].pop('type')
        event_class = get_event_class_by_type(event_type)

        args = msg['args'] if 'args' in msg else {}
        args['id'] = msg['id'] if 'id' in msg else cls._generate_id()
        args['target'] = msg['target'] if 'target' in msg else Config.get('device_id')
        args['origin'] = msg['origin'] if 'origin' in msg else Config.get('device_id')
        args['timestamp'] = msg['_timestamp'] if '_timestamp' in msg else time.time()
        return event_class(**args)
 Builds an event message from a JSON UTF-8 string/bytearray, a
        dictionary, or another Event 
Builds an event message from a JSON UTF-8 string/bytearray, a
dictionary, or another Event
Builds an event message from a JSON UTF - 8 string / bytearray a dictionary or another Event
def build(cls, msg):
        msg = super().parse(msg)
        event_type = msg['args'].pop('type')
        event_class = get_event_class_by_type(event_type)
        args = msg['args'] if 'args' in msg else {}
        args['id'] = msg['id'] if 'id' in msg else cls._generate_id()
        args['target'] = msg['target'] if 'target' in msg else Config.get('device_id')
        args['origin'] = msg['origin'] if 'origin' in msg else Config.get('device_id')
        args['timestamp'] = msg['_timestamp'] if '_timestamp' in msg else time.time()
        return event_class(**args)
def build ( cls , msg ) : msg = super ( ) . parse ( msg ) event_type = msg [ 'args' ] . pop ( 'type' ) event_class = get_event_class_by_type ( event_type ) args = msg [ 'args' ] if 'args' in msg else { } args [ 'id' ] = msg [ 'id' ] if 'id' in msg else cls . _generate_id ( ) args [ 'target' ] = msg [ 'target' ] if 'target' in msg else Config . get ( 'device_id' ) args [ 'origin' ] = msg [ 'origin' ] if 'origin' in msg else Config . get ( 'device_id' ) args [ 'timestamp' ] = msg [ '_timestamp' ] if '_timestamp' in msg else time . time ( ) return event_class ( ** args )
Builds an event message from a JSON UTF-8 string/bytearray, a
dictionary, or another Event
Builds an event message from a JSON UTF - 8 string / bytearray a dictionary or another Event
""" Builds an event message from a JSON UTF-8 string/bytearray, a
        dictionary, or another Event """
cls
msg