Changeset 14733 for misc/runpugs

Show
Ignore:
Timestamp:
11/13/06 11:07:04 (2 years ago)
Author:
andara
Message:

[runpugs]
-Added POD
Please test the runpugs devel version:
interactive: http://feather.perl6.nl:8080/cgi-bin/runpugs2
non-interactive: http://feather.perl6.nl:8080/cgi-bin/runpugs2?ia=0

Location:
misc/runpugs
Files:
2 added
1 removed
11 modified

Legend:

Unmodified
Added
Removed
  • misc/runpugs/cgi-bin/runpugs

    r14512 r14733  
    3838 
    3939my $sessionid=$query->param("sessionid"); 
    40  
     40my $motd=""; 
    4141if (not $sessionid) { 
    4242my $nid=crypt(rand(),'WV'); 
     
    4545my $now=time()-1159056000; # 36 year, 275 days offset 
    4646$sessionid=$nid.$now; 
     47 
     48$motd=' 
     49<p class="warning">Please test the <em>development version</em> of <tt>runpugs</tt>: try the <a 
     50href="http://feather.perl6.nl:8080/cgi-bin/runpugs2">interactive session</a> 
     51with <em>command history</em> or <a 
     52href="http://feather.perl6.nl:8080/cgi-bin/runpugs2?ia=0">run a full Perl 6 script</a>.</p> 
     53'; 
    4754} 
    4855 
     
    130137    while(<HTML>) { 
    131138    s/_TESTING_/$testing/; 
     139    /_MOTD_/ && do { 
     140    $html.=$motd; 
     141    next; 
     142    }; 
    132143    s/_DEV_/$devc/; 
    133144    s/_REL_/$relc/; 
  • misc/runpugs/cgi-bin/runpugs2

    r14512 r14733  
    6363#} 
    6464    my $prompt=$Web::Terminal::Settings::prompt; 
     65    my $allinone=1; 
    6566######### MAIN SITEMANAGER PROGRAM ################### 
    6667 
    6768if ( $query->param()) {      # an action has been chosen 
    68     my $cmd=$query->param("cmdline"); 
     69 
     70    my $cmd=''; 
     71    if ($allinone==1) { 
     72    $cmd=$query->param("cmd");     
     73    my @cmdlines=split("\n",$cmd); 
     74        for my $cmdline (reverse @cmdlines) { 
     75            $cmdline=~/^\s*$/ && next; 
     76            $cmdline=~/$Web::Terminal::Settings::prompt_pattern/ 
     77            && do { 
     78                $cmd=$cmdline; 
     79                $cmd=~s/$Web::Terminal::Settings::prompt_pattern//; 
     80                chomp $cmd; 
     81                last; 
     82        }; 
     83        } 
     84    } else { 
     85    $cmd=$query->param("cmdline"); 
     86    } 
    6987    my $action =  $query->param("action")||'runpugs'; 
    7088    if ($action =~ /^(\w+)$/) { 
     
    104122        $relc=''; 
    105123        } 
    106     my $ia=$query->param('ia')||0; 
     124    my $ia=$query->param('ia'); 
     125    if (not defined $ia) {$ia=1} 
    107126    my $interactive=$ia*1; 
    108127    my $html=''; 
     
    110129    my $clear=0; 
    111130    my $nprompt=$query->param('prompt')||$prompt; 
    112     my $preply=''; 
    113     if($query->param('output')) { 
     131    my $preply='';     
     132    if($allinone==0 and $query->param('output')) { 
    114133        $preply=$query->param('output'); 
     134    } elsif ($allinone==1 and $query->param('cmd')) { 
     135    $preply=$query->param('cmd'); 
    115136    } 
    116137    my $reply=$Web::Terminal::Settings::prompt; 
     
    151172        } 
    152173    } 
    153 #    my $promptw=HTML::Entities::encode_entities($prompt); 
    154174    my $npromptw=HTML::Entities::encode_entities($nprompt); 
    155 #    my $prevcmdw=HTML::Entities::encode_entities($prevcmd); 
    156 #    my $preplyw=HTML::Entities::encode_entities($preply); 
    157      
    158     #my $replyw=HTML::Entities::encode_entities("$preplyw\n$promptw$prevcmdw\n$reply"); 
    159175    my $replyw="$preply$prompt$prevcmd\n$reply"; 
    160 #            $prompt=$nprompt; 
     176    if($allinone==1){ 
     177    $replyw="$preply\n$reply"; 
     178    } 
    161179    if($clear==1) { 
    162180        $replyw=''; 
     
    171189        $historylist.='<option value="'.$entryw.'">'.$entryw.'</option>'."\n"; 
    172190    } 
     191    if ($allinone==1) { 
     192        $replyw.=$nprompt; 
     193    } 
    173194    open(HTML,"<../data/runpugs2.html"); 
    174195    while(<HTML>) { 
     
    177198            next; 
    178199        }; 
     200        /_SKIPT_/ && ($allinone==1) && next; 
     201        /_SKIPC_/ && ($allinone==0) && next; 
    179202        s/_DEV_/$devc/; 
    180203        s/_REL_/$relc/; 
     
    203226        }; 
    204227=cut 
    205         /_REPLYW_/ && do { 
     228        (/_REPLYW_/ && ($allinone==0))|| 
     229        (/_ALL_/ && ($allinone==1)) 
     230        and do { 
    206231            chomp $html; 
    207232            $html.=$replyw; 
    208233            next; 
    209234        }; 
    210         /_NPROMPTW_/ && do { 
     235        /_NPROMPTW_/ && ($allinone==0) && do { 
    211236            chomp $html; 
    212237            $html.=$npromptw; 
  • misc/runpugs/data/runpugs.html

    r14512 r14733  
    2727<div id="mainwindow"> 
    2828<h1>Run Perl 6 now -- in your browser!</h1> 
    29 <p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a 
    30 href="http://dev.perl.org/perl 6/">Perl 6</a>. For more details, read the <a 
    31 href="http://feather.perl6.nl/~andara/runpugs/">info page</a>. 
    32 </p> 
    33 <p>By default, the Pugs session will use the <a 
    34 href="http://search.cpan.org/search?query=perl6%3A%3Apugs&mode=module">latest 
    35 release</a>. To use the latest development snapshot, change the setting 
    36 below.</p> 
    3729 
    3830<form id="term" name="terminal" action="/cgi-bin/runpugs" method="POST">                   
    39                                 
    4031<input type="hidden" name="testing" value="_TESTING_"> 
    4132<input type="hidden" name="sessionid" value=""> 
    4233<input type="hidden"    name="action" value="runpugs"> 
    43 <!--<fieldset>--> 
     34<h2>Interactive Pugs Session</h2> 
     35<!-- _MOTD_ --> 
    4436<input type="radio" id="rel" value="0" name="reldev" _REL_ ><label 
    45 for="rel">Release</label>&nbsp;&nbsp; 
    46 <input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label for="dev">Development</label> 
    47 <!--</fieldset>--> 
    48 <h2>Interactive Pugs Session</h2> 
    49 <!--<textarea id="history" name="history"  rows="1" cols="1" 
    50 style="overflow: hidden; border: 0px; width: 0px; 
    51 font-size:0px">_CMD_</textarea>--> 
    52 <!--<label for="cmd">Interactive Pugs Session<br>--> 
    53 <textarea id="cmd" name="cmd" rows="24" cols="80" wrap="virtual" onKeyPress="return submitenter(this,event)"> 
     37for="rel">Release version</label>&nbsp;&nbsp; 
     38<input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label 
     39for="dev">Development version</label> 
     40<div id="termwindow"> 
     41<textarea id="cmd" name="cmd" rows="23" cols="80" wrap="virtual" onKeyPress="return submitenter(this,event)"> 
    5442pugs&gt;&nbsp; 
    5543</textarea> 
    56 <!--</label>--> 
    57 <br> 
     44</div> 
    5845<input id="enter" type="submit" value="Submit">&nbsp;&nbsp;&nbsp; 
    5946</form> 
    6047<script language="JavaScript"> 
    6148document.terminal.enter.style.display='none'; 
    62 document.terminal.cmd.focus() 
     49document.terminal.cmd.focus(); 
     50document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; 
    6351</script> 
     52<p>This live web terminal runs the <a href="http://www.pugscode.org">Pugs</a> interpreter for <a 
     53href="http://dev.perl.org/perl 6/">Perl 6</a>. Please <a 
     54href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. 
     55</p> 
    6456<p class="copyright">&copy; Copyright 2006 by Wim Vanderbauwhede</p> 
    6557</div> 
  • misc/runpugs/data/runpugs2.html

    r14512 r14733  
    2525function select_enter() 
    2626{ 
     27/* _SKIPC_ 
    2728document.terminal.cmdline.value=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; 
    2829document.terminal.hist.selectedIndex=0; 
    2930document.terminal.cmdline.focus(); 
     31_SKIPC_ */ 
     32/* _SKIPT_ 
     33document.terminal.cmd.value+=document.terminal.hist.options[document.terminal.hist.selectedIndex].value; 
     34document.terminal.hist.selectedIndex=0; 
     35document.terminal.cmd.focus(); 
     36_SKIPT_ */ 
    3037} 
    3138 
     
    5057<div id="mainwindow"> 
    5158<h1>Run Perl 6 now -- in your browser!</h1> 
     59<!-- 
    5260<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a 
    53 href="http://dev.perl.org/perl 6/">Perl&nbsp;6</a>. For more details, read the <a 
    54 href="http://feather.perl6.nl/~andara/runpugs/">info page</a>. 
     61href="http://dev.perl.org/perl 6/">Perl&nbsp;6</a>. Please <a 
     62href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. 
    5563</p> 
    56 <p>By default, the Pugs session will use the <a 
    57 href="http://search.cpan.org/search?query=perl6%3A%3Apugs&mode=module">latest 
    58 release</a>. To use the latest development snapshot, change the setting 
    59 below.</p> 
    60                                 
     64   -->                             
    6165<form id="term" name="terminal" action="/cgi-bin/runpugs2" method="POST">                   
    6266<input type="hidden" name="prompt" value="_PROMPTW_"> 
     
    6569<input type="hidden"    name="action" value="runpugs"> 
    6670<input type="radio" id="rel" value="0" name="reldev" _REL_ ><label 
    67 for="rel">Release</label>&nbsp;&nbsp; 
    68 <input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label for="dev">Development</label> 
     71for="rel">Release version</label>&nbsp;&nbsp; 
     72<input type="radio" id="dev" value="1" name="reldev" _DEV_ ><label 
     73for="dev">Development version</label> 
     74<!-- 
    6975<br><br> 
    7076<span class="tabon">Interactive Pugs Session</span> 
    7177&nbsp;&nbsp;<a class="taboff" href="/cgi-bin/runpugs2?ia=0">Run a Perl 6 Script</a> 
     78--> 
    7279<div id="termwindow"> 
    7380<select name="history" id="hist" onChange="select_enter()"> 
     
    7683</select> 
    7784<br> 
     85<!-- _SKIPT_ 
     86<textarea id="cmd" name="cmd" rows="20" cols="80" wrap="virtual" 
     87onKeyPress="return submitenter(this,event)"> 
     88_ALL_ 
     89</textarea> 
     90_SKIPT_ --> 
     91<!--_SKIPC_ 
    7892<textarea readonly id="output" name="output" rows="_NROWS_" cols="80" wrap="virtual"> 
    7993_REPLYW_ 
     
    86100onKeyPress="return submitenter(this,event)"> 
    87101</label> 
     102_SKIPC_ -->  
    88103</div> 
    89 <br> 
    90104<input id="enter" type="submit" value="Submit">&nbsp;&nbsp;&nbsp; 
    91105</form> 
    92106<script language="JavaScript"> 
    93107document.terminal.enter.style.display='none'; 
    94 document.terminal.cmdline.focus() 
    95 document.terminal.output.scrollTop =document.terminal.output.scrollHeight; 
    96 if (document.terminal.output.rows==1) { 
     108document.terminal.cmdline.focus() // _SKIPT_ 
     109document.terminal.cmd.focus() // _SKIPC_ 
     110document.terminal.output.scrollTop =document.terminal.output.scrollHeight; // _SKIPT_ 
     111document.terminal.cmd.scrollTop =document.terminal.cmd.scrollHeight; // _SKIPC_ 
     112//if (document.terminal.output.rows==1) { 
    97113//document.terminal.output.style.height="2ex"; 
    98 } 
     114//} 
    99115</script> 
     116<p>This live web terminal runs the <a href="http://www.pugscode.org">pugs</a> interpreter for <a 
     117href="http://dev.perl.org/perl 6/">Perl&nbsp;6</a>. Please <a 
     118href="http://feather.perl6.nl/~andara/runpugs/">read the documentation</a>. 
     119</p> 
    100120<p class="copyright">&copy; Copyright 2006 by Wim Vanderbauwhede</p> 
    101121</div> 
  • misc/runpugs/htdocs/index.html

    r14449 r14733  
    1212 
    1313<p>Welcome to <tt>runpugs</tt>, a web terminal for  <a href="http://www.pugscode.org">pugs</a>. Pugs is an implementation of  <a href="http://dev.perl.org/perl6/">Perl 6</a> which aims to implement the full Perl 6 specification.</p> 
    14 <p><tt>runpugs</tt> currently lives <a 
    15 href="http://feather.perl6.nl:8080/cgi-bin/runpugs">here</a>.</p> 
    16 <p><em>Instructions:</em> <tt>runpugs</tt> presents the pugs interactive shell. Only 
    17 the line typed at the last prompt is sent to pugs. Type <code>:h</code> or 
    18 <code>help</code> for 
    19 help, <code>:q</code> (or <code>quit</code> or <code>bye</code>) to quit. 
    20 <br><em>Please</em> be considerate and do <em>quit</em> your 
    21 pugs session  before you close the browser window.<br>Type <code>clear</code> to clear the web terminal (this command is not sent to pugs).</p> 
     14<p><tt>runpugs</tt> lives at <a 
     15href="http://run.pugscode.org">run.pugscode.org</a>.</p> 
     16<p>By default, the Pugs session will use the <a 
     17href="http://search.cpan.org/search?query=perl6%3A%3Apugs">latest 
     18release</a>. You can try the latest development snapshot of Pugs by selecting the 'Development' radio button.</p> 
     19<p>Don't hesitate to test the <em>development version</em> of 
     20<tt>runpugs</tt>:</p><ul><li>try the <a 
     21href="http://feather.perl6.nl:8080/cgi-bin/runpugs2">interactive session</a> 
     22with <em>command history</em></li> <li>or <a 
     23href="http://feather.perl6.nl:8080/cgi-bin/runpugs2?ia=0">run a full Perl 6 
     24script</a> in <em>non-interactive</em> mode.</li></ul> 
     25 
     26<h2>Instructions</h2> 
     27<p><tt>runpugs</tt> presents the pugs interactive shell. Only 
     28the line typed at the last prompt is sent to pugs.</p> 
     29<p><tt>runpugs</tt>-specific commands:</p> 
     30<dl> 
     31<dt><code>help</code></dt><dd> displays the Pugs shell help (same as 
     32<code>:h</code>)</dd><br> 
     33<dt><code>clear</code></dt><dd>clears the web terminal (this command is not sent to the 
     34pugs shell).</dd><br> 
     35<dt><code>quit</code>, <code>bye</code></dt><dd>quit the Pugs session (same as 
     36<code>:q</code>)</dd><br> 
     37</dl> 
     38<p>Please be considerate and do <em>quit</em> your 
     39pugs session  before you close the browser window. 
     40</p> 
     41<h2>Restrictions</h2> 
    2242<p>Because this is a web terminal, a number of restrictions apply:</p> 
    2343 
    2444<ul> 
    25 <li><The code>pugs</code> shell runs in <em>safe mode</em>, so system-related calls are disabled.</li> 
     45<li>The <code>pugs</code> shell runs in <em>safe mode</em>, so system-related calls are disabled.</li> 
    2646<li>If a call takes too long, the <code>pugs</code> session will time out.</li> 
     47<li>If a call produces too much output, the <code>pugs</code> session will 
     48abort.</li> 
    2749<li>If left idle for too long, the <code>pugs</code> session will time out.</li> 
    2850<li>The total number of sessions and number of sessions from a given IP address are limited.</li> 
     
    3153<p>The current values relating to the above restrictions are:</p> 
    3254<ul> 
    33 <li>Maximum number of lines of output: 250</li> 
    3455<li>Inactivity time-out: 10 minutes</li> 
    3556<li>"Long" call time-out: 10 seconds</li> 
     57<li>Maximum number of lines of output: 250</li> 
     58<li>Maximum number of characters perl line of output: 250</li> 
     59<li>Sessions per IP: 10</li> 
    3660<li>Total number of sessions: 50</li> 
    37 <li>Sessions per IP: 10</li> 
    3861<li>Available memory: 64M.</li> 
    3962</ul> 
    40 <p>All of these are open to change if they would prove to be too restrictive.</p> 
     63<p>All of these are open to change if they would prove to be too 
     64restrictive.</p> 
     65<h2>Known issues</h2> 
    4166<p><tt>runpugs</tt> is a very young project, and there will certainly be some bugs. Some known issues are:</p> 
    4267<ul> 
     
    4469<li>There is no command history.</li> 
    4570</ul> 
     71<h2>Source</h2> 
    4672<p>You can find the source code for <tt>runpugs</tt> (in Perl 5) in the <a 
    4773href="http://svn.openfoundry.org/pugs/">pugs subversion repository</a> under 
  • misc/runpugs/htdocs/runpugs.css

    r14512 r14733  
    88    } 
    99H2 { font-weight: bold; font-size: 12pt} 
     10 
     11EM {font-weight: bold; 
     12    font-style: normal; 
     13        text-decoration:none;} 
     14TT {color: #204a87; 
     15        font-weight: bold; 
     16        } 
     17 
    1018LABEL {font-weight: normal; } 
    1119FIELDSET {border: solid white 0px}; 
    12 LEGEND {font-weight:bold; text-align: center; } 
     20LEGEND {font-weight:normal; text-align: left; } 
     21 
     22DL {  
     23} 
     24 
     25DT { 
     26    display:block; 
     27    float: left; 
     28    width: 10ex; 
     29} 
     30 
     31DD { 
     32    display:block ; 
     33    float: left; 
     34} 
     35 
    1336.copyright {font-size: 9pt} 
    1437.warning { 
     
    1639padding: 5px; 
    1740} 
    18 .tabon  
    19 { 
     41.tabon { 
    2042font-weight:bold; 
    2143    background-color: #f2f2f0; 
     
    107129} 
    108130#cmd { 
     131    width: 100%; 
    109132    font-family: "Andale Mono", courier, fixed, monospace; 
    110133    font-size: 11pt; 
     
    113136    color: #204a87; 
    114137    background-color: #f2f2f0; 
    115     border: solid 2px #204a87; 
    116     padding: 5px; 
     138    border: solid 0px #f2f2f0; 
     139/*    border: solid 2px #204a87; 
     140    padding: 5px;*/ 
    117141} 
    118142/* Linkdefinities */ 
  • misc/runpugs/lib/Web/Terminal/Dispatcher.pm

    r14512 r14733  
    9292        } 
    9393} 
     94 
     95__END__ 
     96 
     97=head1 NAME 
     98 
     99Web::Terminal::Dispatcher -- Dispatches commands to a  terminal 
     100session 
     101Requires YAML::Syck. 
     102 
     103=head1 SYNOPSIS 
     104 
     105   use Web::Terminal::Dispatcher; 
     106   use Web::Terminal::Settings; 
     107 
     108    ($reply, $prompt, $histref) = 
     109    &Web::Terminal::Dispatcher::send($sessionid,$ip,$version,$interactive,$cmd); 
     110 
     111=head1 DESCRIPTION 
     112 
     113This module exports a single subroutine C<send>. The arguments are: 
     114    $sessionid: a string identifying the session 
     115    $ip: the IP address of the client as a dotted-decimal string 
     116    $version: an integer indicating the version of the terminal application to 
     117    be used. The value is the index in the list of C<commands> (see L<Settings.pm>).  
     118    $interactive: if 1, the session is interactive, else it's batch mode 
     119    $cmd: the actual command to be sent to the terminal application. 
     120 
     121The call to C<send> returns a list containing: 
     122    $reply: a string containing the reply from the terminal application 
     123    $prompt: a string containing the prompt from the terminal application 
     124    $histref: a reference to a list of the most recent commands (see 
     125    Settings.pm) 
     126 
     127=head1 SEE ALSO 
     128 
     129L<Web::Terminal::Settings>, 
     130L<Web::Terminal::Server>, 
     131L<Web::Terminal::Server::Session>, 
     132L<Web::Terminal::Msg> 
     133 
     134=head1 AUTHOR 
     135 
     136Wim Vanderbauwhede <wim.vanderbauwhede@gmail.com> 
     137 
     138=head1 COPYRIGHT 
     139 
     140Copyright (c) 2006. Wim Vanderbauwhede. All rights reserved. 
     141 
     142This program is free software; you can redistribute it and/or modify 
     143it under the same terms as Perl itself. 
     144 
     145See L<http://www.perl.com/perl/misc/Artistic.html> 
     146 
     147=cut 
  • misc/runpugs/lib/Web/Terminal/Msg.pm

    r14430 r14733  
    324324__END__ 
    325325 
    326 COPYRIGHT 1997 Sriram Srinivasan 
    327  
    328 http://search.cpan.org/src/SRIRAM/examples/Networking/Msg.pm 
     326=head1 NAME 
     327 
     328Web::Terminal::Msg -- Client/Server messaging framework  
     329 
     330=head1 SYNOPSIS 
     331 
     332    use Web::Terminal::Msg; 
     333    # in Dispatcher: 
     334    $conn = Web::Terminal::Msg->connect( $host, $port, \&rcvd_msg_from_server ); 
     335    # in Server: 
     336    Web::Terminal::Msg->new_server( $host, $port, \&login_proc ); 
     337    Web::Terminal::Msg->event_loop(); 
     338 
     339=head1 AUTHORS 
     340 
     341Sriram Srinivasan created Msg.pm for his excellent book "Advanced Perl Programming"; 
     342Wim Vanderbauwhede made some minor modifications to incorporate it in 
     343Web::Terminal. 
     344 
     345=head1 COPYRIGHT  
     346 
     347Copyright (c) 1997 Sriram Srinivasan. All rights reserved. 
     348Copyright (c) 2006 Wim Vanderbauwhede <wim.vanderbauwhede@gmail.com>. All 
     349rights reserved. 
     350 
     351L<http://search.cpan.org/src/SRIRAM/examples/Networking/Msg.pm> 
     352 
     353This program is free software; you can redistribute it and/or modify it 
     354under the same terms as Perl itself. 
     355 
     356See L<http://www.perl.com/perl/misc/Artistic.html> 
     357=cut 
  • misc/runpugs/lib/Web/Terminal/Server.pm

    r14512 r14733  
    2424$SIG{CHLD} = 'IGNORE'; 
    2525 
    26 =pod 
    27 The messages contain the session id. 
    28 If the ID does not exist in %terminals, create a new session 
    29 Otherwise, write to the terminal and send back the result, again 
    30 with the session id as first line. 
    31 =cut 
     26# The messages contain the session id. 
     27# If the ID does not exist in %terminals, create a new session 
     28# Otherwise, write to the terminal and send back the result, again 
     29# with the session id as first line. 
    3230 
    3331our %terminals=(); 
     
    5351                        my $term = $terminals{$id}; 
    5452                    $term->{called}=time; 
    55                 my $init= $term->{'init'}; 
     53                my $output= $term->{'output'}; 
    5654                my $error= $term->{'error'}; 
    5755                if ($error==1) { # Failed to create a new terminal 
     
    5957                delete $terminals{$id}; 
    6058                }  
    61                 return $init; 
     59                return $output; 
    6260        } 
    6361                my $term  = $terminals{$id}; 
     
    8482         return "Sorry, you can't run more than ${Web::Terminal::Settings::nsessions_ip} sessions from one IP address.\n";    
    8583        } else { 
    86         print "New $id\n"; 
     84        #print "New $id\n"; 
    8785            $sessions_per_ip{$ip}++; 
    88             print "$app $ia $id $cmd\n"; 
     86            #print "$app $ia $id $cmd\n"; 
    8987                $terminals{$id} = new 
    9088            Web::Terminal::Server::Session(app=>$app,ia=>$ia,id=>$id,cmds=>$cmd); 
     
    122120            } 
    123121            my $nsess=scalar keys %terminals; 
    124             print scalar(localtime)," : $nsess : $ip : $id : $pid > ",$cmd,"\n"; 
     122            #print scalar(localtime)," : $nsess : $ip : $id : $pid > ",$cmd,"\n"; 
    125123            print LOG2 scalar(localtime)," : $nsess : $ip : $id : $pid > ",$cmd,"\n"; 
    126124                        my $lines = &termhandler( $id, $ip, $app,$ia, $cmd ); 
     
    160158if ($pid=fork) { 
    161159    #parent here 
    162     if (-e "/home/andara/apache/data/runpugs2.log") { 
    163         rename "/home/andara/apache/data/runpugs2.log","/home/andara/apache/data/runpugs2.log.".join("",localtime); 
    164     } 
    165     open(LOG2,">/home/andara/apache/data/runpugs2.log"); 
     160    if (-e 
     161    "$Web::Terminal::Settings::data_path/$Web::Terminal::Settings::appname.log") { 
     162        rename 
     163        "$Web::Terminal::Settings::data_path/$Web::Terminal::Settings::appname.log", 
     164        "$Web::Terminal::Settings::data_path/$Web::Terminal::Settings::appname.log.".join("",localtime); 
     165    } 
     166    open(LOG2,">$Web::Terminal::Settings::data_path/$Web::Terminal::Settings::appname.log"); 
    166167    Web::Terminal::Msg->new_server( $host, $port, \&login_proc ); 
    167168    Web::Terminal::Msg->event_loop(); 
     
    216217 
    2172181; 
     219 
     220__END__ 
     221 
     222=head1 NAME 
     223 
     224Web::Terminal::Server -- Server for Web::Terminal 
     225Requires YAML::Syck, Proc::Daemon. 
     226 
     227=head1 SYNOPSIS 
     228 
     229    use Web::Terminal::Server; 
     230    use  Web::Terminal::Settings; 
     231    &Web::Terminal::Server::run(); 
     232 
     233=head1 DESCRIPTION 
     234 
     235This module exports a single subroutine C<run>, which runs the Web::Terminal 
     236server. See L<Settings> for configuration options. 
     237 
     238=head1 SEE ALSO 
     239 
     240L<Web::Terminal::Settings>, 
     241L<Web::Terminal::Dispatcher>, 
     242L<Web::Terminal::Server::Session>, 
     243L<Web::Terminal::Msg> 
     244 
     245=head1 AUTHOR 
     246 
     247Wim Vanderbauwhede <wim.vanderbauwhede@gmail.com> 
     248 
     249=head1 COPYRIGHT 
     250 
     251Copyright (c) 2006. Wim Vanderbauwhede. All rights reserved. 
     252 
     253This program is free software; you can redistribute it and/or modify 
     254it under the same terms as Perl itself. 
     255 
     256See L<http://www.perl.com/perl/misc/Artistic.html> 
     257 
     258=cut 
  • misc/runpugs/lib/Web/Terminal/Server/Session.pm

    r14512 r14733  
    77 
    88use Web::Terminal::Settings; 
    9 =pod 
    10 A thin wrapper around Net::Telnet 
    11 new() starts the session; 
    12 write() sends commands to it. 
    13 =cut 
     9 
     10#A thin wrapper around Net::Telnet 
     11#new() starts the session; 
     12#write() sends commands to it. 
    1413