From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: Submit Confirmation
   Date: Mon, 09 Jan 2012 21:08:06 -0500
Msg# 2189
View Complete Thread (23 articles) | All Threads
Last Next
On 01/09/12 17:48, Mr. Daniel Browne wrote:
In certain situations, some users wanted the ability to re-render elements individually. I've gone with simply adding an extra flag to RushSubmit in .common.pl to bypass the "ok" message window when desired.

    Sounds good.

    Just so you know how I handled this in the newer releases of Rush:

    So as not to break old scripts, I left the old RushSubmit() function's argument
    list untouched, and made a new function called RushSubmitEx() which takes a
    single hash as its argument, so that many flags can be optionally set as needed.

    This way the new function can have new args added without affecting the calling syntax,
    new scripts can use the new function, and old scripts can continue to use the old function,
    which just turns around and calls the new function to do all the work, eg:



# [NEW] SUBMIT A JOB TO RUSH, WITH OPTIONS TO CONTROL SUBMIT BEHAVIOR
#     Returns "" if submitted OK with $ENV{RUSH_JOBID} containing the jobid.
#     Returns error message if submit failed, $ENV{RUSH_JOBID} is unchanged.
#
#     $1 - text to submit
#     $2 - REFERENCE: hash of options. Can be an empty hash for defaults.
# [..docs of all flags snipped to keep this email short..]
#
sub RushSubmitEx($%)
{
   ..does the actual work..
}

# [OLD] SUBMIT A JOB TO RUSH, SHOW CONFIRMATIONS, START IRUSH
#     Returns 0 if ok with $ENV{RUSH_JOBID} containing the jobid, or 1 on error.
#     If you want more features, use the newer RushSubmitEx().
#     $1 - submit host
#     $2 - text to submit
#     $3 - job title (can be "")
#     $4 - start irush (yes/no/ask)
#
sub RushSubmit($$$$)
{
    my ($submithost, $submit, $jobtitle, $startirush) = @_;
    my %options;
    $options{SubmitHost}    = $submithost;
    $options{IrushJobTitle} = $jobtitle;
    $options{StartIrush}    = $startirush;
    my $errmsg = RushSubmitEx($submit, %options);
    return(($errmsg eq "") ? 0 : 1);
}  



-- 
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/
Tel: (Tel# suppressed)ext.23
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)


Last Next