NAME
Perlbug::Format - Formats for email interface to perlbug database.
DESCRIPTION
Different formats which can be applied to the data returned from the perlbug database via l<Perlbug> (l<Web>, l<Email> and l<Cmd>) interfaces: aAhHl
If html is required, -f h
should be used. The first letter following the -f
switch is the only one used to define which format to use for all results emanating from a single email, -f h
being set by default for a web call.
Specific objects supported include: Bugs, Messages, Users, Patches, Tests and Notes.
Currently this is not relevant for the -q
(sql query) switch, as there is little value in attempting to second guess what may be called for in sql statements.
SYNOPSIS
my $o_fmt = Perlbug::Format->new;
my %data = (
'some' => 'data',
'other' => 'stuff',
);
my $str = $o_fmt->fmt(\%data);
print $str; # 'some=data\nother=stuff\n'
FORMATS
a ascii short - minimal listings default for mail interface
A ASCII long - maximal block style listings
h html short - minimal listings default for web interface
H HTML short - maximal block style listings
l lean list - ascii but purely for parsing minimal data
L lean HTML - like l, but with html links - yek
METHODS
- new
-
Create new Perlbug::Format object:
my $do = Perlbug::Format->new();
- context
-
Set context ascii or html, sets pre- and post- values
- line_break
-
Return the current line-break
- pre
-
Return the current pre-setting
- pre
-
Return the current post-setting
- fmt
-
Default printout (of given hash, or anything) - very basic formatter of simple data.
%data = ( 'this' => 'that', 'here' => [qw(there up down turnaround)], ); print $pb->fmt(\%data);
this=that here=there up down turnaround
- _fmt_sql
-
Format sql queries
- format_data
-
Formats this, and writes (via a format) to results file.
If it recognises the object via: bug(id), message(id), patch(id), note(id), user(id) the appropriate formatting is applied.
my $res = $format->format_data(\%this);
- format_fields
-
Format individual entries for output, handles bugs, messages, users, patches, tests, notes
my $h_tkt = $o_perlbug->format_fields($h_tkt);
- schema
-
Schema for database, should allow the database to format this for us ...
- overview
-
Formating for overview.
$fmt{'bugs'} = $data{'bugs'};
- format_this
-
Wrapper for calls to filehandle, local data.
my $res = $obj->format_this('res', "FORMAT_$type_$format", $max); # $res = ''
- _current_target
-
Any call which includes format_this(), format_data etc. will automatically set the _current_target to a copy of that data. This can then be inspected from here.
print Dumper($obj->_current_target);
- start
-
Sets start header for results.
- format_bug_fields
-
Format individual bug entries for placement
my $h_tkt = $o_web->format_bug_fields($h_tkt);
- format_message_fields
-
Format individual message entries for placement
my $h_msg = $o_web->format_message_fields($h_msg);
- format_patch_fields
-
Format individual patch entries for placement
my $h_pat = $o_web->format_patch_fields($h_pat);
- format_test_fields
-
Format individual test entries for placement
my $h_test = $o_web->format_test_fields($h_test);
- format_note_fields
-
Format individual note entries for placement
my $h_msg = $o_web->format_note_fields($h_msg);
- format_user_fields
-
Format individual user entries for placement
my $h_usr = $o_web->format_user_fields($h_usr);
- href
-
Return list of perlbug.cgi?req=id&... hyperlinks to given list).
Maintains format, rng etc.
my @links = $o_web->href('bid', \@bids, 'visible element of link', [optional subject hint]);
- mailto
-
Return mailto: for a particular ticket
my $mailto = $o_web->mailto($h_tkt);
- popup
-
Returns appropriate (cached) popup with optional default value inserted.
my $popup = $web->popup('status', $unique_id, $default); $self->debug(3, "Admin ($1) of bug ($id) called."); $tkt{'category'} = $self->popup('category', $tkt{'category'}, $id.'_category'); $tkt{'osname'} = $self->popup('osname', $id.'_osname', $tkt{'osname'}); $tkt{'select'} = $cgi->checkbox(-'name'=>'ticketid', -'checked' => '', -'value'=> $id); $tkt{'severity'} = $self->popup('severity', $id.'_severity', $tkt{'severity'}); $tkt{'status'} = $self->popup('status', $id.'_status', $tkt{'status'});
- FORMAT_B_l
-
Lean ascii format for tickets:
- FORMAT_B_A
-
Default ASCII format for bugs:
...
- FORMAT_B_h
-
Html minimal format: ...
- FORMAT_B_H
-
Html, tabled in block format: ...
- FORMAT_O_a
-
Formating for overview (default). ...
- FORMAT_O_h_TOP
-
Formatting for html overview.
- FORMAT_S_a
-
Default format for Schema fields for database (top elsewhere).
- FORMAT_S_h
-
Html format for Schema fields for database (top elsewhere temporarily).
- FORMAT_M_l
-
Messages lean format.
- FORMAT_M_a
-
Messages list format.
- FORMAT_M_A
-
Messages block ASCII format.
- FORMAT_M_h
-
Messages in list html format.
- FORMAT_M_H
-
Messages in block html format.
- FORMAT_U_l
-
User list format.
- FORMAT_U_a
-
User list format.
- FORMAT_U_h
-
User in list html format.
- FORMAT_H_l
-
History list format.
- FORMAT_H_a
-
History list format.
- FORMAT_H_h
-
History in list html format.
- FORMAT_N_l
-
Note lean format.
- FORMAT_N_a
-
Note list format.
- FORMAT_N_A
-
Note block ASCII format.
- FORMAT_N_h
-
Note in list html format.
- FORMAT_N_H
-
Note in block html format.
- FORMAT_P_l
-
Patch lean format.
- FORMAT_P_a
-
Patch list format.
- FORMAT_P_A
-
Patch block ASCII format.
- FORMAT_P_h
-
Note in list html format.
- FORMAT_P_H
-
Patch in block html format
- FORMAT_T_l
-
Test lean format.
- FORMAT_T_a
-
Test list format.
- FORMAT_T_A
-
Test block ASCII format.
- FORMAT_T_h
-
Test in list html format.
- FORMAT_T_H
-
Test in block html format
AUTHOR
Richard Foley perlbug@rfi.net Oct 1999
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1003:
=pod directives shouldn't be over one line long! Ignoring all 26 lines of content