[Ml-yokadi] We should use Keyword in a smarter way
Aurélien Gâteau
aurelien.gateau
Dim 15 Fév 23:21:06 CET 2009
Sébastien Renard wrote:
> Le samedi 14 février 2009, Sébastien Renard a écrit :
>> Le vendredi 13 février 2009, Aurélien Gâteau a écrit :
>>> This looks more natural to me. The rule would be "if the first word ends
>>> with a ':', it is a project name". This rule would apply to t_add,
>>> t_edit and t_list as well. What do you think about this?
>> I like it. Much more natural.
>
> I think the good way to implement it would be to have a legacy switch
> (-p --project) and make the change myproject: => -p myproject in parse_args
> method of YokadiOptionParser. Like keyword (@lala => -k lala).
Adding a legacy switch sounds a bit hackish to me and I do not like the
fact that YokadiOptionParser is handling the "@keyword" syntax. I was
thinking it should be implemented by:
- Removing -k from parser options in t_add, t_edit and t_list.
- Introducing parseutils.extractKeywords() which would accept a text and
returns a tuple (text, {keywordDict})
- Rewriting parseutils.parseTaskLine() to support "@keyword" and
"project:" syntax, using extracKeywords().
t_add and t_edit would use parseTaskLine(), as they do now.
t_list would use extractKeywords(), providing a syntax like this:
- t_list foo => all tasks of project "foo"
- t_list @bar => all tasks of all projects with keyword "bar"
- t_list default @bar => all tasks of default project with keyword "bar"
- t_list foo_% => all tasks of all projects whose names start with "foo_".
Aurélien
Plus d'informations sur la liste de diffusion Ml-yokadi