Exemplo n.º 1
0
 def do_job(self):
     active_task = Task.get_active_task()
     if active_task:
         print('Aborting active task: %s' % active_task)
         DBSession.delete(active_task)
         DBSession.commit()
     else:
         print("You don't have any active task")
Exemplo n.º 2
0
    def do_job(self):
        active_task = Task.get_active_task()
        if not active_task:
            print("You don't have any active task")
            return

        active_task.end()
        DBSession.commit()
        print('Task ended: %s' % active_task)
Exemplo n.º 3
0
    def do_job(self):
        active_task = Task.get_active_task()
        if active_task:
            print 'You have an active task: %s' % active_task
            answer = raw_input("Do you want to terminate the currently active task ([y]/n)? ")
            if not answer or answer.lower() == 'y':
                active_task.end()
            else:
                return

        subject = Subject.ensure(self.args.subject)
        task = Task(title=' '.join(self.args.task))
        subject.tasks.append(task)

        DBSession.commit()
        print 'Started task: %s' % task
Exemplo n.º 4
0
    def do_job(self):
        active_task = Task.get_active_task()
        if active_task:
            print('You have an active task: %s' % active_task)
            answer = input(
                "Do you want to terminate the currently active task ([y]/n)? ")
            if not answer or answer.lower() == 'y':
                active_task.end()
            else:
                return

        subject = Subject.ensure(self.args.subject)
        task = Task(title=' '.join(self.args.task),
                    user=config.user
                    if hasattr(config, 'user') else os.environ.get('USER'))
        subject.tasks.append(task)

        DBSession.commit()
        print('Started task: %s' % task)
Exemplo n.º 5
0
 def do_job(self):
     active_task = Task.get_active_task()
     if active_task:
         print('Active task: %s' % active_task)
     else:
         print("You don't have any active task")
Exemplo n.º 6
0
 def do_job(self):
     active_task = Task.get_active_task()
     if active_task:
         print('Active task: %s' % active_task)
     else:
         print("You don't have any active task")