<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1700" Guid="{1BDA8A04-5813-401E-A439-4FF33CB614DA}" Time="1451826778.93">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="Speech" Guid="{76A1638D-1D7D-4582-A726-A17B1A6FC723}" File="Speech">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="FileOperations" Guid="{50D933C5-F93B-4A8A-A6CE-95A40F906036}" File="FileOperations">
            gAIpLg==
        </Plugin>
    </Autostart>
    <Folder Name="Config tree root" Expanded="True">
        <Folder Name=" 2016 Diary" Expanded="True">
            <Macro Name="Python Script Diary" Expanded="True">
                <Event Name="Main.OnInit" />
                <Action>
                    EventGhost.PythonScript(u'diary_root = "\u202aC:\\2016 Diary"\ncode_page = eg.systemEncoding\n\nfrom datetime import date as dt\nfrom calendar import setfirstweekday, monthcalendar\nfrom os.path import isfile\nimport codecs\n\nWEEK = ("Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday")\nYEAR = (\n    "January",\n    "February",\n    "March",\n    "April",\n    "May",\n    "June",\n    "July",\n    "August",\n    "September",\n    "October",\n    "November",\n    "December"\n)\ntoday = dt.today()\nday  = today.day\nwd = today.isoweekday() - 1\nsetfirstweekday(0)\nmonth = monthcalendar(today.year, today.month)\nweek = 1 + [w[wd] for w in month].index(day)\ntoday_file = r"%s\\%i Diary\\%s\\Week %i\\%s.txt" % (diary_root, today.year, YEAR[today.month-1], week, WEEK[wd])\n\nif not isfile(today_file):\n    eg.Exit()\neg.PrintNotice("File valid for today: " + today_file)\n\ninput = codecs.open(today_file, \'r\', code_page, \'ignore\')\ndata = input.readlines()\ninput.close()\nfor line in data:\n    #Here data parsing (time detection)\n    eg.TriggerEvent("Speak", prefix = "Diary", payload = line)')
                </Action>
            </Macro>
            <Macro Name="Speech: Speak: Speech: Speak: {eg.event.payload}" Expanded="True">
                <Event Name="Diary.Speak" />
                <Action>
                    Speech.TextToSpeech(u'IVONA 2 Amy - British English female voice [22kHz]', 0, u'Speech: Speak: {eg.event.payload}', 0, 100)
                </Action>
                <Action>
                    FileOperations.Read(0, u'C:\\2016 Diary\\January\\Week 1\\Sunday.txt', 0, 0, 'cp1252', 1, False, 1)
                </Action>
            </Macro>
        </Folder>
    </Folder>
</EventGhost>
