summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/other/parse_todo.pl42
1 files changed, 26 insertions, 16 deletions
diff --git a/data/other/parse_todo.pl b/data/other/parse_todo.pl
index f4a95002e..e8b131cd2 100644
--- a/data/other/parse_todo.pl
+++ b/data/other/parse_todo.pl
@@ -17,13 +17,36 @@ my %todo_hash;
17my $title; 17my $title;
18my $item = {}; 18my $item = {};
19 19
20# use globals
21sub push_item {
22 if ($item->{'task'}) {
23 my $task = $item->{'task'};
24 $task =~ s/^\* //;
25 if ($task =~ s/<(.*)>//) {
26 $item->{'asignee_email'} = $1;
27 $1 =~ /(.*) AT /;
28 $item->{'asignee'} = $1;
29 } else {
30 $item->{'asignee_email'} = 0;
31 $item->{'asignee'} = 'None';
32 }
33 $item->{'task'} = $task;
34 push(@{$todo_hash{$title}}, $item);
35 }
36}
37
20while(<>) { 38while(<>) {
21 chomp; 39 chomp;
22 40
23 if(/\[\[\[/) { 41 if(/\[\[\[/) {
42 $item->{'task'} = 0;
24 $in_body = 1; 43 $in_body = 1;
25 } elsif (/\]\]\]/) { 44 } elsif (/\]\]\]/) {
26 $in_body = 0; 45 if ($in_body) {
46 push_item;
47 $item = {};
48 $in_body = 0;
49 }
27 } elsif (/^---.*---$/) { 50 } elsif (/^---.*---$/) {
28 if ($in_body) { 51 if ($in_body) {
29 if($is_title) { 52 if($is_title) {
@@ -34,20 +57,7 @@ while(<>) {
34 } 57 }
35 } elsif (/^\* /) { 58 } elsif (/^\* /) {
36 if ($in_body ) { 59 if ($in_body ) {
37 if ($item->{'task'}) { 60 push_item;
38 my $task = $item->{'task'};
39 $task =~ s/^\* //;
40 if ($task =~ s/<(.*)>//) {
41 $item->{'asignee_email'} = $1;
42 $1 =~ /(.*) AT /;
43 $item->{'asignee'} = $1;
44 } else {
45 $item->{'asignee_email'} = 0;
46 $item->{'asignee'} = 'None';
47 }
48 $item->{'task'} = $task;
49 push(@{$todo_hash{$title}}, $item);
50 }
51 $item = {}; 61 $item = {};
52 $item->{'task'} = $_ ; 62 $item->{'task'} = $_ ;
53 } 63 }
@@ -77,7 +87,7 @@ for $title ( keys %todo_hash ) {
77 my $mailto; 87 my $mailto;
78 88
79 if ($asignee_email) { 89 if ($asignee_email) {
80 $mailto = "<a href='mailto:$asignee_email'>$asignee</a>" 90 $mailto = "<a href='mailto://$asignee_email'>$asignee</a>"
81 } else { 91 } else {
82 $mailto = $asignee; 92 $mailto = $asignee;
83 } 93 }