Skip to content

tasklib should respect context or support it as an option IMO #133

@5balls

Description

@5balls

I think context should be supported.

As a workaround I have code similar to this:

from tasklib import TaskWarrior

tw = TaskWarrior(data_location='~/.task')

context = tw.execute_command(["_get","rc.context"])[0]

if context:
  context_read = tw.execute_command(["_get","rc.context." + context + ".read"])[0]
  context_filter = '+PENDING and ( ' + context_read + ')'
  nexttasks = tw.tasks.filter(context_filter)
else:
  nexttasks = tw.tasks.pending()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions