| Perlbug documentation | view source | Contained in the Perlbug distribution. |
Perlbug::Do - Commands (switches) for generic interface to perlbug database.
Methods for various functions against the perlbug database.
Those that have the form /do(?i:a-z)/ all return something relevant.
To be printed, returned by email, etc.
Note that all do...() methods expect to recieve one of the following arguments:
Either a string, an arrayref, or a hashref (helpful - huh?)
my $h_cmds = $o_do->parse_input($line); # parse string print $o_do->process_commands($h_cmds); # calls do($cmd, $args) foreach
Create new Perlbug::Do object:
my $o_do = Perlbug::Do->new();
Parses the given line into a reference to a command hash, this is also where the input should be massaged into the correct format for each method call.
Wraps input2args(), override on a per interface basis, where appropriate.
Input line is expected to look like: -h -b (bugid)+ -r (keywords)+ ...
my $h_cmds = $o_do->parse_input($line);
parse_input without the input2args
my $h_cmds = $o_do->parse_input($line);
Return appropriate type of argument wanted given command
my $wanted = $self->return_type($cmd); eg: b -> ARRAY P -> HASH s -> SCALAR
Handles email input, calls SUPER::input2args()
my $cmd_args = $o_do->input2args($cmd, $args);
Interface to all do() methods, calls SUPER::process_commands().
my @res = $o_do->process_commands(\%args);
Where %args looks something like this:
my %args = ( 'a' => \@categories_status_etc, 'B' => \%new_data, 'b' => \@bug_ids, 'h' => \%extra_info, 'l' => $date || '', 'q' => $sql_query, 'z' => $config_type, 'Z' => [($type, $string)], );
Wrap a Perlbug::dox command where 'x' may be any alphabetic character.
Each do() command returns the product of it's call for output.
print "Bugs(@bugids): ".join('', $pb->do('b', \@bugids));
print "New bug: ".join('', $pb->do('B', '', $newbug));
print "New msg: ".join('', $pb->do('M', $bugidstring, $message)); # Base
print "New msg: ".join('', $pb->do('M', $bugidstring, \%mail)); # Email
ONLY do this if registered as admin
my @res = $o_do->doa($command_string);
Wrapper for doa(), calls dob() also.
my @res = $o_do->doa($command_string);
Return the formatted bug by id/s
my @res = $o_do->dob(@bugids);
Create new bug, returning id.
my $bugid = $o_do->doB(\%bug);
Get the patches, or bugs for this changeid
my @res = $o_do->doc(\@cids);
Create a new changeid
my $cid = $o_do->doC($h_args);
Switches debugging on (1).
my $level_set = $o_do->dod($level);
Dumps database for backup and recovery.
my $feedback = $o_do->doD($date);
Returns database dump command (mysql/oracle) for given date (or full) and target file.
else undef
my $cmd = $o_do->database_dump_command($date, $file);
Add email address to any cc's 'Cc:' to "-e me.too@some.where.org"
my $i_set = $o_do->doe($cc_addrs);
Send an email notify() about th(is|ese) bugid/s, as if the email was newly recieved.
my $i_ok = $o_obj->doE(\@bugids);
Sets the appropriate format for use by Formatter methods, overrides default 'a' set earlier.
my $feedback = $o_obj->dof('h');
Return the formatted group by id/s
my @res = $o_do->dog(\@groupids);
Create new group
my $new_gid = $o_do->doG($h_args);
Returns help message built from a hash_ref
Syntax for the hash is 'key => description (sample args)':
print $o_obj->doh({
'e' => 'email me a copy too (email@address.com)',
# add 'H' => 'Help - more detailed info ()',
# replace 'z' => '',
});
Retrieve by index (group, status, etc.)
my @res = $o_do->doi($str);
Wrapper for doi(), in large format
my @res = $o_do->doI('open');
Just test for a response - produces "$title $version => ok"
my @res = $o_do->doj(@args);
Klaim the bug(id) given
my $feedback = $o_do->dok(\@bids);
UnKlaim the bug(id) given
my $feedback = $o_do->doK(\@bids);
Just the stored log results from this process.
my $process_log = $o_do->dol($max_lines_from_end);
Returns the current (or given later) logfile.
my $LOG = $o_do->doL($date);
Return the formatted message by id/s
my @data = $o_do->dom(\@messageids);
Create new message
my $new_mid = $o_do->doM($h_args);
Return the formatted user by id/s
my @res = $o_do->don(\@nids);
Creates new note (assigns to given bugid).
my $nid = $self->doN($h_args);
Returns a summary overview of the bugs, bugs, messages etc. in the database.
my @over = $o_do->doo();
Get stats from db for overview usage.
my $h_data = $self->stats;
Return the formatted patch by id/s
my @res = $o_do->dop(\@patchids);
Assign to given bugid, given patch, return new patch_id
$pid = $o_obj->doP($h_args);
Gets the sql _q_ query statement given in the body of the message, executes it, and returns the result in the result array.
my @results = $o_do->doq($sql);
Returns the database schema, for use with SQL statements.
my @tables_data = $o_do->doQ;
Retrieve data based on contents of the body of a bug
my @res = $o_do->dor('object initialisation problem');
Wrapper for dor(), in large format
my @res = $o_do->doR('object initialisation problem');
Retrieve bugs based on the subject line of a bug
my @res = $o_do->dos('build failure');
Wrapper for dos() in 'large format'
my @RES = $o_do->doS('some subject');
and R
foreach my $bid (@args) {
push(@res, $o_bug->read($bid)->format());
my @mids = $o_bug->rel_ids('message');
my ($mid) = sort { $a <=> $b } @mids;
push(@res, $self->dom(\@mids));
my @pids = $o_bug->rel_ids('patch');
push(@res, $self->dop(\@pids));
my @tids = $o_bug->rel_ids('test');
push(@res, $self->dot(\@tids));
my @nids = $o_bug->rel_ids('note');
push(@res, $self->don(\@nids));
}
Return the formatted test by id/s
my @res = $o_do->dot(\@testids);
Assign to given bugid, given test, return i_ok
$new_tid = $o_obj->doT($h_args);
Return the formatted user by id/s
my @res = $o_do->dou(\@userids);
Create new user entry
my $uid = $self->doU($h_args);
Initiate new admin entry, including htpasswd entry, (currently rf only)
userid = test_user: password = p*ss33*t: address = perlbugtest@rfi.net: match_address =.*\@rfi\.net: name = Richard Foley:
Volunteer proposed bug modifications where msg is something like: 'propose_close_<bugid>@bugs.perl.org'
my $i_ok = $o_obj->dov($h_args);
Volunteer a new administrator
my $feedback = $o_do->doV($h_args);
Delete bug from db_bug table.
Use doX for messages associated with bugs.
my @feedback = $o_do->dox(\@bids);
Delete given bugs along with messages from db_message.
Also does parent/child, bug_user, etc. tables, also calls dox()
my @feedback = $o_do->doX(\@bids);
Password renewal
my $i_ok = $o_do->doy("$user $pass");
Retrieve configuration data
$data = $o_obj->doz([qw(current email target)]);
Attempt to set current configuration data, for this session only
my $debuglevel = $o_obj->doZ('debug', 2);
my $switches = $o_obj->doZ('switches', 'abcdef');
Formatting for overview.
my $overview = $o_do->overview($h_overview, [$fmt]);
Formating for lean overview (currently wrapper for FORMAT_a
my ($top, $format, @args) = $o_fmt->FORMAT_l(\%overview);
Formating for Lean Html overview (currently wrapper for FORMAT_h
my ($top, $format, @args) = $o_fmt->FORMAT_L(\%overview);
Formating for overview (default).
my ($top, $format, @args) = $o_fmt->FORMAT_a(\%overview);
Formatting for ASCII overview.
my ($top, $format, @args) = $o_fmt->FORMAT_O_A(\%overview);
Formatting for html overview.
my ($top, $format, @args) = $o_fmt->FORMAT_O_h(\%overview);
Formatting for HTML overview.
my ($top, $format, @args) = $o_fmt->FORMAT_O_H(\%overview);
Richard Foley perlbug@rfi.net Oct 1999 2000 2001
| Perlbug documentation | view source | Contained in the Perlbug distribution. |