Enlightenment CVS committal

Author  : handyande
Project : e17
Module  : apps/e

Dir     : e17/apps/e/data/other


Modified Files:
        parse_todo.pl 


Log Message:
shorne's parser patch, thanks man
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/data/other/parse_todo.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- parse_todo.pl       27 Jun 2005 13:49:21 -0000      1.3
+++ parse_todo.pl       27 Jun 2005 15:52:58 -0000      1.4
@@ -17,9 +17,6 @@
 my $title;
 my $item = {};
 
-my $item_count;
-my $total_item_count = 0;
-
 while(<>) {
        chomp;    
 
@@ -37,19 +34,25 @@
                }
        } elsif (/^\* /) {
                if ($in_body ) {
-                       $total_item_count++;
                        $_ =~ s/^\* //;
                        push(@{$todo_hash{$title}}, $item);
                        $item = {};
                        $item->{'asignee'} = "Unknown";
                        $item->{'task'} = $_ ;
                        if(/<(.*)>/) {
-                               $item->{'asignee'} = $1;
+                               my $email = $1;
+                               if ($email =~ /(.*) AT /) {                     
+                                       $item->{'asignee'} = $1;
+                                       $item->{'asignee_email'} = $email;
+                               } else {
+                                       $item->{'asignee'} = $email;
+                                       $item->{'asignee_email'} = 0;
+                               }
                        }
                }
        } else {
                if ($in_body) {
-                       if($is_title) {
+                       if ($is_title) {
                                $title = $_;
                        } else {
                                $item->{'task'} = $item->{'task'} . $_ ;
@@ -69,9 +72,18 @@
        print "<table>\n";
        print "    <tr><td>Asignee</td><td>Task</td></tr>\n";
        for $item ( @{$todo_hash{$title}} ) {
+               my $asignee_email = $item->{'asignee_email'};
                my $asignee = $item->{'asignee'};
                my $task = $item->{'task'};
-               print "    <tr><td>$asignee</td><td>$task</td></tr>\n";
+
+               my $mailto;
+
+               if ($asignee_email) {
+                    $mailto = "<a href='mailto:$asignee_email'>$asignee</a>"   
+               } else {
+                    $mailto = $asignee;
+               }
+               print "    <tr><td>$mailto</td><td>$task</td></tr>\n";
        }
        print "</table>\n";
 }




-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to