package Maasha::Biopieces;
-# Copyright (C) 2007-2008 Martin A. Hansen.
+# Copyright (C) 2007-2009 Martin A. Hansen.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> LOG <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my $log_global = Maasha::Common::append_open( "$ENV{ 'BP_LOG' }/biopieces.log" );
-my $log_local = Maasha::Common::append_open( "$ENV{ 'HOME' }/.biopieces.log" );
+my ( $log_global, $log_local );
+
+$log_global = Maasha::Common::append_open( "$ENV{ 'BP_LOG' }/biopieces.log" );
+$log_local = Maasha::Common::append_open( "$ENV{ 'HOME' }/.biopieces.log" );
$log_global->autoflush( 1 );
$log_local->autoflush( 1 );
$wiki = Maasha::Gwiki::gwiki_read( $file );
+ ( $wiki->[ 2 ], $wiki->[ 3 ], $wiki->[ 0 ], $wiki->[ 1 ] ) = ( $wiki->[ 0 ], $wiki->[ 1 ], $wiki->[ 2 ], $wiki->[ 3 ] );
+
if ( not $options->{ "help" } ) {
- @{ $wiki } = grep { $_->[ 0 ]->{ 'SECTION' } =~ /Biopiece|Synopsis|Usage|Options|Help/ } @{ $wiki };
+ @{ $wiki } = grep { $_->[ 0 ]->{ 'SECTION' } =~ /Biopiece|summary|Usage|Options|Help/ } @{ $wiki };
}
$lines = Maasha::Gwiki::gwiki2ascii( $wiki );
{
# Martin A. Hansen, January 2008.
- # Prints the synopsis from the usage for each of the biopieces.
+ # Prints the summary from the usage for each of the biopieces.
my ( $in, # handle to in stream
$out, # handle to out stream
# Returns nothing.
- my ( @files, $file, $wiki, $program, $synopsis );
+ my ( @files, $file, $wiki, $program, $summary );
@files = Maasha::Common::ls_files( "$ENV{ 'BP_DIR' }/bp_usage" );
$wiki = Maasha::Gwiki::gwiki_read( $file );
- @{ $wiki } = grep { $_->[ 0 ]->{ 'SECTION' } =~ /Synopsis/ } @{ $wiki };
- @{ $wiki } = grep { $_->[ 0 ]->{ 'FORMAT' } =~ /paragraph/ } @{ $wiki };
-
- $synopsis = $wiki->[ 0 ]->[ 0 ]->{ 'TEXT' };
- $synopsis =~ s/!(\w)/$1/g;
+ $summary = $wiki->[ 0 ]->[ 0 ]->{ 'TEXT' };
+ $summary =~ s/^#summary\s+//;
- printf( "%-30s%s\n", $program, $synopsis );
+ printf( "%-30s%s\n", $program, $summary );
}
}
if ( defined $record->{ $key } )
{
- return 1 if ( $op eq "<" and $record->{ $key } < $val );
- return 1 if ( $op eq ">" and $record->{ $key } > $val );
+ return 1 if ( $op eq "<" and $record->{ $key } < $val );
+ return 1 if ( $op eq ">" and $record->{ $key } > $val );
return 1 if ( $op eq ">=" and $record->{ $key } >= $val );
return 1 if ( $op eq "<=" and $record->{ $key } <= $val );
- return 1 if ( $op eq "=" and $record->{ $key } == $val );
+ return 1 if ( $op eq "=" and $record->{ $key } == $val );
return 1 if ( $op eq "!=" and $record->{ $key } != $val );
return 1 if ( $op eq "eq" and $record->{ $key } eq $val );
return 1 if ( $op eq "ne" and $record->{ $key } ne $val );
$sid = $2;
$pid = $3;
- next if $user eq "m.hansen";
+# next if $user eq "maasha"; # DEBUG
if ( $user eq Maasha::Common::get_user() )
{
package Maasha::Gwiki;
-# Copyright (C) 2008 Martin A. Hansen.
+# Copyright (C) 2008-2009 Martin A. Hansen.
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
{
push @lines, text_bold( "$block->[ 0 ]->{ 'TEXT' }" );
}
+ elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "summary" )
+ {
+ $block->[ 0 ]->{ 'TEXT' } =~ s/^#summary\s+//;
+
+ push @lines, text_bold( "Summary" ), "\n$block->[ 0 ]->{ 'TEXT' }";
+ }
elsif ( $block->[ 0 ]->{ 'FORMAT' } eq "level_3" )
{
push @lines, "$block->[ 0 ]->{ 'TEXT' }";
{
undef @block;
- if ( $lines[ $i ] =~ /^===\s*(.+)\s*===$/ )
+ if ( $lines[ $i ] =~ /^(#summary.+)/ )
+ {
+ $section = $1;
+
+ push @block, {
+ TEXT => $section,
+ SECTION => $section,
+ FORMAT => "summary",
+ };
+ }
+ elsif ( $lines[ $i ] =~ /^===\s*(.+)\s*===$/ )
{
$section = $1;