Browse Source

Remove documentation from individual modules; just refer to Template.pm

Morten Brix Pedersen 25 years ago
parent
commit
a111b076b5

+ 25 - 25
modules/Pisg/Parser/Format/Template.pm

@@ -35,18 +35,18 @@ sub normalline
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	# Most log formats are regular enough that you can just match the
-	# appropriate things with parentheses in the regular expression.
+        # Most log formats are regular enough that you can just match the
+        # appropriate things with parentheses in the regular expression.
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
@@ -57,18 +57,18 @@ sub actionline
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	# Most log formats are regular enough that you can just match the
-	# appropriate things with parentheses in the regular expression.
+        # Most log formats are regular enough that you can just match the
+        # appropriate things with parentheses in the regular expression.
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
@@ -79,32 +79,32 @@ sub actionline
 #   hour            - the hour we're in (for timestamp logging)
 #   min             - the minute we're in (for timestamp logging)
 #   nick            - the nick
-#   kicker          - the nick which were kicked (if any)
+#   kicker          - the nick which kicked somebody (if any)
 #   newtopic        - the new topic (if any)
 #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
 #   newjoin         - a new nick which has joined the channel
 #   newnick         - a person has changed nick and this is the new nick
 #
 # The hash may also have a "repeated" key indicating the number of times
-# the line was repeated.
+# the line was repeated. (Used by eggdrops log for example.)
 sub thirdline
 {
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	$self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
+        $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
 
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-	$hash{nick} = $3;
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+        $hash{nick} = $3;
 
-	# Format-specific stuff goes here.
+        # Format-specific stuff goes here.
 
-	return \%hash;
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 50 - 62
modules/Pisg/Parser/Format/bxlog.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::bxlog;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,98 +21,84 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour}    = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}    = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	$self->{debug}->("[$lines] ***: $1 $2 $3 $4");
-
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-
-	if ($3 eq '<') {
-	    if  ($4 =~ /^([^!]+)!\S+ was kicked off \S+ by ([^!]+)!/) {
-		$hash{kicker} = $2;
-		$hash{nick} = $1;
-	    }
-
-	} elsif ($3 eq '>') {
-	    if ($4 =~ /^([^!])+!\S+ has joined \S+$/) {
-		$hash{nick} = $1;
-		$hash{newjoin} = $1;
-	    }
-
-	} elsif ($3 eq '@') {
-	    if ($4 =~ /^Topic by ([^!:])[!:]*: (.*)$/) {
-		$hash{nick} = $1;
-		$hash{newtopic} = $2;
-
-	    } elsif ($4 =~ /^mode \S+ \[([\S]+) [^\]]+\] by ([^!]+)!\S+$/) {
-		$hash{newmode} = $1;
-		$hash{nick} = $2;
-	    }
-
-	} elsif ($3 eq '!') {
-	    if ($4 =~ /^(\S+) is known as (\S+)$/) {
-		$hash{nick} = $1;
-		$hash{newnick} = $2;
-	    }
-	}
-
-	return \%hash;
+        $self->{debug}->("[$lines] ***: $1 $2 $3 $4");
+
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+
+        if ($3 eq '<') {
+            if  ($4 =~ /^([^!]+)!\S+ was kicked off \S+ by ([^!]+)!/) {
+                $hash{kicker} = $2;
+                $hash{nick} = $1;
+            }
+
+        } elsif ($3 eq '>') {
+            if ($4 =~ /^([^!])+!\S+ has joined \S+$/) {
+                $hash{nick} = $1;
+                $hash{newjoin} = $1;
+            }
+
+        } elsif ($3 eq '@') {
+            if ($4 =~ /^Topic by ([^!:])[!:]*: (.*)$/) {
+                $hash{nick} = $1;
+                $hash{newtopic} = $2;
+
+            } elsif ($4 =~ /^mode \S+ \[([\S]+) [^\]]+\] by ([^!]+)!\S+$/) {
+                $hash{newmode} = $1;
+                $hash{nick} = $2;
+            }
+
+        } elsif ($3 eq '!') {
+            if ($4 =~ /^(\S+) is known as (\S+)$/) {
+                $hash{nick} = $1;
+                $hash{newnick} = $2;
+            }
+        }
+
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 56 - 71
modules/Pisg/Parser/Format/eggdrop.pm

@@ -1,8 +1,10 @@
 package Pisg::Parser::Format::eggdrop;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
- 
+
 sub new
 {
     my $type = shift;
@@ -19,106 +21,89 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
-    #
-    # The hash my also have a "repeated" key indicating the number of times
-    # the line was repeated.
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	if (defined $7) {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
-	} else {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6");
-	}
-
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-	$hash{nick} = $3;
-
-	if (($4.$5) eq 'kickedfrom') {
-	    $7 =~ /^ by ([\S]+):.*/;
-	    $hash{kicker} = $1;
-
-	} elsif ($3 eq 'Topic') {
-	    $7 =~ /^ by ([\S]+)![\S]+: (.*)/;
-	    $hash{nick} = $1;
-	    $hash{newtopic} = $2;
-
-	} elsif (($4.$5) eq 'modechange') {
-	    my $newmode = $6;
-	    if ($7 =~ /^ .+ by ([\S]+)!.*/) {
-		$hash{nick} = $1;
-		$newmode =~ s/^\'//;
-		$hash{newmode} = $newmode;
-	    }
-
-	} elsif ($5 eq 'joined') {
-	    $hash{newjoin} = $3;
-
-	} elsif (($3.$4) eq 'Nickchange:') {
-	    $hash{nick} = $5;
-	    $7 =~ /([\S]+)/;
-	    $hash{newnick} = $1;
-
-	} elsif (($3.$4.$5) eq 'Lastmessagerepeated') {
-	    $hash{repeated} = $6;
-	}
-
-	return \%hash;
+        if (defined $7) {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
+        } else {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6");
+        }
+
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+        $hash{nick} = $3;
+
+        if (($4.$5) eq 'kickedfrom') {
+            $7 =~ /^ by ([\S]+):.*/;
+            $hash{kicker} = $1;
+
+        } elsif ($3 eq 'Topic') {
+            $7 =~ /^ by ([\S]+)![\S]+: (.*)/;
+            $hash{nick} = $1;
+            $hash{newtopic} = $2;
+
+        } elsif (($4.$5) eq 'modechange') {
+            my $newmode = $6;
+            if ($7 =~ /^ .+ by ([\S]+)!.*/) {
+                $hash{nick} = $1;
+                $newmode =~ s/^\'//;
+                $hash{newmode} = $newmode;
+            }
+
+        } elsif ($5 eq 'joined') {
+            $hash{newjoin} = $3;
+
+        } elsif (($3.$4) eq 'Nickchange:') {
+            $hash{nick} = $5;
+            $7 =~ /([\S]+)/;
+            $hash{newnick} = $1;
+
+        } elsif (($3.$4.$5) eq 'Lastmessagerepeated') {
+            $hash{repeated} = $6;
+        }
+
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 40 - 52
modules/Pisg/Parser/Format/grufti.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::grufti;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,95 +21,81 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	if (defined $9) {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
-	} else {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
-	}
+        if (defined $9) {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
+        } else {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
+        }
 
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-	$hash{nick} = $3;
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+        $hash{nick} = $3;
 
-	if ($5 eq 'kicked') {
-	    $hash{kicker} = $3;
-	    $hash{nick} = $6;
+        if ($5 eq 'kicked') {
+            $hash{kicker} = $3;
+            $hash{nick} = $6;
 
-	} elsif (($4.$5) eq 'haschanged') {
-	    $hash{newtopic} = $9;
+        } elsif (($4.$5) eq 'haschanged') {
+            $hash{newtopic} = $9;
 
-	} elsif (($4.$5) eq 'modechange') {
-	    $hash{newmode} = substr($6, 1);
-	    $hash{nick} = $9;
-	    $hash{nick} =~ /.*[by ](\S+)/;
-	    $hash{nick} = $1;
+        } elsif (($4.$5) eq 'modechange') {
+            $hash{newmode} = substr($6, 1);
+            $hash{nick} = $9;
+            $hash{nick} =~ /.*[by ](\S+)/;
+            $hash{nick} = $1;
 
-	} elsif ($5 eq 'joined') {
-	    $hash{newjoin} = $1;
+        } elsif ($5 eq 'joined') {
+            $hash{newjoin} = $1;
 
-	} elsif (($3.$4) eq 'Nickchange') {
-	    $hash{nick} = $7;
-	    $hash{newnick} = $9;
-	}
+        } elsif (($3.$4) eq 'Nickchange') {
+            $hash{nick} = $7;
+            $hash{newnick} = $9;
+        }
 
-	return \%hash;
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 2 - 14
modules/Pisg/Parser/Format/irssi.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::irssi;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,7 +21,6 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
@@ -38,7 +39,6 @@ sub normalline
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
@@ -57,18 +57,6 @@ sub actionline
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 

+ 35 - 47
modules/Pisg/Parser/Format/mIRC.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::mIRC;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,90 +21,76 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	if (defined $8) {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
-	} else {
-	    $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
-	}
+        if (defined $8) {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8");
+        } else {
+            $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7");
+        }
 
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-	$hash{nick} = $3;
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+        $hash{nick} = $3;
 
-	if (($4.$5) eq 'waskicked') {
-	    $hash{kicker} = $7;
+        if (($4.$5) eq 'waskicked') {
+            $hash{kicker} = $7;
 
-	} elsif ($4 eq 'changes') {
-	    $hash{newtopic} = "$7 $8";
+        } elsif ($4 eq 'changes') {
+            $hash{newtopic} = "$7 $8";
 
-	} elsif (($4.$5) eq 'setsmode:') {
-	    $hash{newmode} = $6;
+        } elsif (($4.$5) eq 'setsmode:') {
+            $hash{newmode} = $6;
 
-	} elsif (($5.$6) eq 'hasjoined') {
-	    $hash{newjoin} = $3;
+        } elsif (($5.$6) eq 'hasjoined') {
+            $hash{newjoin} = $3;
 
-	} elsif (($4.$5) eq 'nowknown') {
-	    $hash{newnick} = $8;
-	}
+        } elsif (($4.$5) eq 'nowknown') {
+            $hash{newnick} = $8;
+        }
 
-	return \%hash;
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 39 - 51
modules/Pisg/Parser/Format/mbot.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::mbot;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,94 +21,80 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour}   = $1;
-	$hash{nick}   = $2;
-	$hash{saying} = $3;
+        $hash{hour}   = $1;
+        $hash{nick}   = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	my $debugstring = "[$lines] ***: $1 $2 $3 $4";
-	$debugstring .= " $5" if (defined $5);
-	$debugstring .= " $6" if (defined $6);
-	$debugstring .= " $7" if (defined $7);
-	$self->{debug}->($debugstring);
+        my $debugstring = "[$lines] ***: $1 $2 $3 $4";
+        $debugstring .= " $5" if (defined $5);
+        $debugstring .= " $6" if (defined $6);
+        $debugstring .= " $7" if (defined $7);
+        $self->{debug}->($debugstring);
 
-	$hash{hour} = $1;
-	$hash{min}  = $2;
-	$hash{nick} = $3;
+        $hash{hour} = $1;
+        $hash{min}  = $2;
+        $hash{nick} = $3;
 
-	if ($4 eq 'KICK') {
-	    $hash{kicker} = $3;
-	    $hash{nick} = $5;
+        if ($4 eq 'KICK') {
+            $hash{kicker} = $3;
+            $hash{nick} = $5;
 
-	} elsif ($4 eq 'TOPIC') {
-	    $hash{newtopic} = $5;
-	    $hash{newtopic} =~ s/^.*://;
+        } elsif ($4 eq 'TOPIC') {
+            $hash{newtopic} = $5;
+            $hash{newtopic} =~ s/^.*://;
 
-	} elsif ($4 eq 'MODE') {
-	    $hash{newmode} = $5;
+        } elsif ($4 eq 'MODE') {
+            $hash{newmode} = $5;
 
-	} elsif ($4 eq 'JOIN') {
-	    $3 =~ /^([^!]+)!/;
-	    $hash{newjoin} = $1;
-	    $hash{nick} = $1;
+        } elsif ($4 eq 'JOIN') {
+            $3 =~ /^([^!]+)!/;
+            $hash{newjoin} = $1;
+            $hash{nick} = $1;
 
-	} elsif ($4 eq 'NICK') {
-	    $hash{newnick} = $5;
-	}
+        } elsif ($4 eq 'NICK') {
+            $hash{newnick} = $5;
+        }
 
-	return \%hash;
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }
 

+ 2 - 14
modules/Pisg/Parser/Format/psybnc.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::psybnc;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,7 +21,6 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
@@ -38,7 +39,6 @@ sub normalline
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
@@ -57,18 +57,6 @@ sub actionline
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 

+ 34 - 46
modules/Pisg/Parser/Format/xchat.pm

@@ -1,5 +1,7 @@
 package Pisg::Parser::Format::xchat;
 
+# Documentation for the Pisg::Parser::Format modules is found in Template.pm
+
 use strict;
 $^W = 1;
 
@@ -19,90 +21,76 @@ sub new
 
 sub normalline
 {
-    # Parse a normal line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{normalline}/) {
-	$self->{debug}->("[$lines] Normal: $1 $2 $3");
+        $self->{debug}->("[$lines] Normal: $1 $2 $3");
 
-	$hash{hour} = $1;
-	$hash{nick} = $2;
-	$hash{saying} = $3;
+        $hash{hour} = $1;
+        $hash{nick} = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub actionline
 {
-    # Parse an action line - returns a hash with 'hour', 'nick' and 'saying'
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{actionline}/) {
-	$self->{debug}->("[$lines] Action: $1 $2 $3");
+        $self->{debug}->("[$lines] Action: $1 $2 $3");
 
-	$hash{hour} = $1;
-	$hash{nick} = $2;
-	$hash{saying} = $3;
+        $hash{hour} = $1;
+        $hash{nick} = $2;
+        $hash{saying} = $3;
 
-	return \%hash;
+        return \%hash;
     } else {
-	return;
+        return;
     }
 }
 
 sub thirdline
 {
-    # Parses the 'third' line - (the third line is everything else, like
-    # topic changes, mode changes, kicks, etc.)
-    # thirdline() have to return a hash with the following keys, for
-    # every format:
-    #   hour            - the hour we're in (for timestamp loggin)
-    #   min             - the minute we're in (for timestamp loggin)
-    #   nick            - the nick
-    #   kicker          - the nick which were kicked (if any)
-    #   newtopic        - the new topic (if any)
-    #   newmode         - deops or ops, must be '+o' or '-o', or '+ooo'
-    #   newjoin         - a new nick which has joined the channel
-    #   newnick         - a person has changed nick and this is the new nick
     my ($self, $line, $lines) = @_;
     my %hash;
 
     if ($line =~ /$self->{thirdline}/) {
-	$self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
+        $self->{debug}->("[$lines] ***: $1 $2 $3 $4 $5 $6 $7 $8 $9");
 
-	$hash{hour} = $1;
-	$hash{min} = $2;
-	$hash{nick} = $3;
+        $hash{hour} = $1;
+        $hash{min} = $2;
+        $hash{nick} = $3;
 
-	if (($4.$5) eq 'haskicked') {
-	    $hash{kicker} = $3;
-	    $hash{nick} = $6;
+        if (($4.$5) eq 'haskicked') {
+            $hash{kicker} = $3;
+            $hash{nick} = $6;
 
-	} elsif (($4.$5) eq 'haschanged') {
-	    $hash{newtopic} = $9;
+        } elsif (($4.$5) eq 'haschanged') {
+            $hash{newtopic} = $9;
 
-	} elsif (($4.$5) eq 'giveschannel') {
-	    $hash{newmode} = '+o';
+        } elsif (($4.$5) eq 'giveschannel') {
+            $hash{newmode} = '+o';
 
-	} elsif (($4.$5) eq 'removeschannel') {
-	    $hash{newmode} = '-o';
+        } elsif (($4.$5) eq 'removeschannel') {
+            $hash{newmode} = '-o';
 
-	} elsif (($5.$6) eq 'hasjoined') {
-	    $hash{newjoin} = $1;
+        } elsif (($5.$6) eq 'hasjoined') {
+            $hash{newjoin} = $1;
 
-	} elsif (($5.$6) eq 'nowknown') {
-	    $hash{newnick} = $8;
-	}
+        } elsif (($5.$6) eq 'nowknown') {
+            $hash{newnick} = $8;
+        }
 
-	return \%hash;
+        return \%hash;
 
     } else {
-	return;
+        return;
     }
 }