示例#1
0
from planner.planner import Planner

import googledistancematrix as gdm
from googledistancematrix import querent
from googledistancematrix.querent import Querent

import settings, globals
settings.init()

gdm_querent = gdm.querent.Querent(
    api_key=settings.GOOGLE_DISTANCE_MATRIX_API_KEY)
gdm_querent.set_travel_mode(querent.TravelMode.TRANSIT)

p = Planner()

p.set_home("Str d Pariser Kommune 30")
p.set_planning_times(globals.to_minutes(8, 0), globals.to_minutes(20, 0))
p.set_max_events(3)

p.add_event(
    Event("Kuchenbacken",
          Event.EventType.SPECIFIC,
          start=globals.to_minutes(17, 45),
          end=globals.to_minutes(19, 00),
          place="Str d Pariser Kommune 30"), [30, 6, 2019])

p.add_event(
    Event("Buch lesen",
          Event.EventType.SPECIFIC,
          start=globals.to_minutes(13, 20),
          end=globals.to_minutes(14, 00),
示例#2
0
from planner.plannertoimage import PlannerToImage
from planner.planner import Planner

import globals

from datetime import datetime as dt

if __name__ == "__main__":
    planner = Planner()

    planner.set_home("Str d Pariser Kommune 30")
    planner.set_planning_times(
        globals.to_minutes(8, 0),
        globals.to_minutes(20, 0)
    )
    planner.set_max_events(8)

    planner.import_ics('import_planner_draw.ics')
    #planner.import_ics('exported_calendar.ics')
    print(planner)

    PlannerToImage(planner, dt.today()).draw_image('test_image.png')
    #PlannerToImage(planner, dt(2019,4,11)).draw_image('test_image.png')