# Path: scarlett/events.py
# def scarlett_event(event_type, data=None, origin=EVENT_LOCAL,
#                    make_dict=False):
#     """ Returns a dict representation of this Event. """
#     if make_dict:
#         _data = dict(data)
#     else:
#         _data = data
# 
#     return {
#         'event_type': event_type,
#         'data': _data,
#         'origin': str(origin)
#     }
# 
# Path: scarlett/constants.py
# EVENT_SCARLETT_START = "scarlett_start"
# 
# EVENT_SCARLETT_STOP = "scarlett_stop"
# 
# EVENT_STATE_CHANGED = "state_changed"
# 
# EVENT_TIME_CHANGED = "time_changed"
# 
# EVENT_CALL_SERVICE = "call_service"
# 
# EVENT_SERVICE_EXECUTED = "service_executed"
# 
# EVENT_SERVICE_REGISTER = "service_register"
# 
# EVENT_PLATFORM_DISCOVERED = "platform_discovered"
# 
# EVENT_SCARLETT_SAY = "scarlett_speak"
# 
# EVENT_BRAIN_UPDATE = "scarlett_brain_update"
# 
# EVENT_BRAIN_CHECK = "scarlett_brain_check"


import scarlett
import time
import datetime
import gobject
import dbus
import dbus.service
from scarlett.features import *
from scarlett.events import scarlett_event
from colorama import init, Fore, Back, Style
from scarlett.constants import (
    EVENT_SCARLETT_START,
    EVENT_SCARLETT_STOP,
    EVENT_STATE_CHANGED,
    EVENT_TIME_CHANGED,
    EVENT_CALL_SERVICE,
    EVENT_SERVICE_EXECUTED,
    EVENT_SERVICE_REGISTER,
    EVENT_PLATFORM_DISCOVERED,
    EVENT_SCARLETT_SAY,
    EVENT_BRAIN_UPDATE,
    EVENT_BRAIN_CHECK
)

    def get_current_time(self):
        self.now = self.set_now()
        self.do_set_property(
            'now-time', self.now.strftime("It is now, %I:%M %p"))
        return self.now_time

    def get_current_date(self):
        self.now = self.set_now()
        self.do_set_property(
            'now-date', self.now.strftime("Today's date is, %A, %B %d, %Y"))
        return self.now_date

    def set_now(self, override=False):
        if override:
            self.now = override
            return override
        return datetime.datetime.now()

    def get_time(self):
        return self.now

    def do_time_started(self, now_time):
        scarlett.log.info(
            Fore.GREEN +
            "self.current_time: " +
            now_time)

    def start(self):
        # register service start

# Path: scarlett/events.py
# def scarlett_event(event_type, data=None, origin=EVENT_LOCAL,
#                    make_dict=False):
#     """ Returns a dict representation of this Event. """
#     if make_dict:
#         _data = dict(data)
#     else:
#         _data = data
# 
#     return {
#         'event_type': event_type,
#         'data': _data,
#         'origin': str(origin)
#     }
# 
# Path: scarlett/constants.py
# EVENT_SCARLETT_START = "scarlett_start"
# 
# EVENT_SCARLETT_STOP = "scarlett_stop"
# 
# EVENT_STATE_CHANGED = "state_changed"
# 
# EVENT_TIME_CHANGED = "time_changed"
# 
# EVENT_CALL_SERVICE = "call_service"
# 
# EVENT_SERVICE_EXECUTED = "service_executed"
# 
# EVENT_SERVICE_REGISTER = "service_register"
# 
# EVENT_PLATFORM_DISCOVERED = "platform_discovered"
# 
# EVENT_SCARLETT_SAY = "scarlett_speak"
# 
# EVENT_BRAIN_UPDATE = "scarlett_brain_update"
# 
# EVENT_BRAIN_CHECK = "scarlett_brain_check"


# Path: scarlett/features/time.py
import scarlett
import time
import datetime
import gobject
import dbus
import dbus.service
from scarlett.features import *
from scarlett.events import scarlett_event
from colorama import init, Fore, Back, Style
from scarlett.constants import (
    EVENT_SCARLETT_START,
    EVENT_SCARLETT_STOP,
    EVENT_STATE_CHANGED,
    EVENT_TIME_CHANGED,
    EVENT_CALL_SERVICE,
    EVENT_SERVICE_EXECUTED,
    EVENT_SERVICE_REGISTER,
    EVENT_PLATFORM_DISCOVERED,
    EVENT_SCARLETT_SAY,
    EVENT_BRAIN_UPDATE,
    EVENT_BRAIN_CHECK
)


    def get_current_time(self):
        self.now = self.set_now()
        self.do_set_property(
            'now-time', self.now.strftime("It is now, %I:%M %p"))
        return self.now_time

    def get_current_date(self):
        self.now = self.set_now()
        self.do_set_property(
            'now-date', self.now.strftime("Today's date is, %A, %B %d, %Y"))
        return self.now_date

    def set_now(self, override=False):
        if override:
            self.now = override
            return override
        return datetime.datetime.now()

    def get_time(self):
        return self.now

    def do_time_started(self, now_time):
        scarlett.log.info(
            Fore.GREEN +
            "self.current_time: " +
            now_time)

    def start(self):
        # register service start

        register_sstart = scarlett_event("service_state",