From: <enl...@li...> - 2005-06-29 13:22:10
|
Enlightenment CVS committal Author : handyande Project : e17 Module : apps/e Dir : e17/apps/e/data/other Modified Files: parse_todo.pl Log Message: shorne whaddya on? :) =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/data/other/parse_todo.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- parse_todo.pl 28 Jun 2005 12:48:48 -0000 1.5 +++ parse_todo.pl 29 Jun 2005 13:22:04 -0000 1.6 @@ -17,13 +17,36 @@ my $title; my $item = {}; +# use globals +sub push_item { + if ($item->{'task'}) { + my $task = $item->{'task'}; + $task =~ s/^\* //; + if ($task =~ s/<(.*)>//) { + $item->{'asignee_email'} = $1; + $1 =~ /(.*) AT /; + $item->{'asignee'} = $1; + } else { + $item->{'asignee_email'} = 0; + $item->{'asignee'} = 'None'; + } + $item->{'task'} = $task; + push(@{$todo_hash{$title}}, $item); + } +} + while(<>) { chomp; if(/\[\[\[/) { + $item->{'task'} = 0; $in_body = 1; } elsif (/\]\]\]/) { - $in_body = 0; + if ($in_body) { + push_item; + $item = {}; + $in_body = 0; + } } elsif (/^---.*---$/) { if ($in_body) { if($is_title) { @@ -34,20 +57,7 @@ } } elsif (/^\* /) { if ($in_body ) { - if ($item->{'task'}) { - my $task = $item->{'task'}; - $task =~ s/^\* //; - if ($task =~ s/<(.*)>//) { - $item->{'asignee_email'} = $1; - $1 =~ /(.*) AT /; - $item->{'asignee'} = $1; - } else { - $item->{'asignee_email'} = 0; - $item->{'asignee'} = 'None'; - } - $item->{'task'} = $task; - push(@{$todo_hash{$title}}, $item); - } + push_item; $item = {}; $item->{'task'} = $_ ; } @@ -77,7 +87,7 @@ my $mailto; if ($asignee_email) { - $mailto = "<a href='mailto:$asignee_email'>$asignee</a>" + $mailto = "<a href='mailto://$asignee_email'>$asignee</a>" } else { $mailto = $asignee; } |