Пример #1
0
 def hibernate_item():
     hibernated = api.get_somedaymaybe()
     if len(hibernated) == 1:
         parent = hibernated[0]
     elif len(hibernated) > 1:
         choice = userinput.ask_choice('Where to?',
                                       choices=hibernated,
                                       default=0,
                                       category="project")
         parent = hibernated[choice]
     else:
         print("No someday projects defined. Where to move it?")
         parent = userinput.ask_project(api)
     item.hibernate(parent)
     print("Action hibernated to {}".format(parent))
Пример #2
0
 def activate_item():
     targetprojects = api.get_targetprojects(self)
     if len(targetprojects) == 1:
         parent = targetprojects[0]
     elif len(targetprojects) > 1:
         choice = userinput.ask_choice('Where to?',
                                       choices=targetprojects,
                                       default=0,
                                       category="project")
         parent = targetprojects[choice]
     else:
         print("No target projects defined. Where to move?")
         parent = userinput.ask_project(api)
     item.activate(parent)
     print("Item activated")
Пример #3
0
 def activate_project():
     # TODO: check if project is already active
     targetprojects = api.get_targetprojects()
     if len(targetprojects) == 1:
         parent = targetprojects[0]
     elif len(targetprojects) > 1:
         choice = userinput.ask_choice('Where to?',
                                       choices=targetprojects,
                                       default=0,
                                       category="project")
         parent = targetprojects[choice]
     else:
         print("No target projects defined. Where to move?")
         parent = userinput.ask_project(api)
     project.activate(parent)
     print("Project activated")
Пример #4
0
    def hibernate_project():
        hibernated = api.get_somedaymaybe()
        if len(hibernated) == 1:
            parent = hibernated[0]
        elif len(hibernated) > 1:
            choice = userinput.ask_choice('Where to?',
                                          choices=hibernated,
                                          default=0,
                                          category="project")
            parent = hibernated[choice]
        else:
            print("No someday projects defined. Where to move?")
            parent = userinput.ask_project(api)

        print("Reactivate at some date?")
        date = userinput.ask_date(api)
        if date == 'none':
            date = None
        project.hibernate(parent, date)
        print("Project hibernated to {}".format(parent))
Пример #5
0
 def move_project():
     print("Choose new parent project:")
     new_parent = userinput.ask_project(api)
     project.move_project(new_parent)
     print('Project moved')
Пример #6
0
 def move_item():
     project = userinput.ask_project(api, default=item.get_project())
     item.move_to_project(project)
     print("Project set")