Changeset 4485285 for examples


Ignore:
Timestamp:
Jan 12, 2013, 1:43:31 PM (12 years ago)
Author:
Jason Gross <jasongross9@gmail.com>
Parents:
4626016 (diff), 7869e48 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge 7869e4801e577613b7db987d11bddb0a31fe755c into 46260161946c87dfed4fef9e3223b2327895f139
Location:
examples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • examples/owlconf.erik

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22###
    33### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!!
    4 ### This is an example file intended to demonstrate how to use 
     4### This is an example file intended to demonstrate how to use
    55### various features of owl.  Some of the key bindings, in particular,
    66### are more for examples than things you may actually want to use.
     
    3030### The message attributes may be dereferenced with $m->attribute
    3131###
    32 ###   
     32###
    3333
    3434# tokens for sepbar are:
     
    122122}
    123123
    124 # Load in things which don't belong in an owlconf 
     124# Load in things which don't belong in an owlconf
    125125# that people might use as an example...
    126126sub personal_startup {
     
    231231            sepbartokens_add("<$sender");
    232232            sepbartokens_trim(">$sender");
    233         } 
     233        }
    234234    } elsif ($m->is_mail) {
    235235        mail_add_message($m);
     
    249249    my ($b) = @_;
    250250    $b=~s/^/    /g;
    251     $b=~s/\n/\n    /g;   
     251    $b=~s/\n/\n    /g;
    252252    return $b;
    253253}
     
    282282    }
    283283
    284     if (!$m->is_zephyr && !$m->is_aim) { 
     284    if (!$m->is_zephyr && !$m->is_aim) {
    285285        return "Unknown message type: ".$m->type."\n";
    286286    }
     
    308308
    309309    if ($m->is_zephyr) {
    310         $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class), 
     310        $out = sprintf "[mit,%s,%s] / %s / %s", lc($m->class),
    311311        lc($m->instance), $m->time, lc($m->host);
    312312        if ($m->opcode ne "") {$out.=" op:".$m->opcode;}
     
    322322            }
    323323        }
    324         $out.="\n";             
     324        $out.="\n";
    325325    } else {
    326326        $out = sprintf "[%s] / %s\n", lc($m->type), $m->time;
    327327        $out.= "  \@bold($sender)> ";
    328         $out.="\n";             
     328        $out.="\n";
    329329    }
    330330
     
    380380    }
    381381
    382     if (!$m->is_zephyr && !$m->is_aim) { 
     382    if (!$m->is_zephyr && !$m->is_aim) {
    383383        return "Unknown message type: ".$m->type."\n";
    384384    }
     
    402402        }
    403403        return "$out\n";
    404                
     404
    405405    } elsif ($m->is_zephyr && $m->is_mail) {
    406406        my $body = $m->body;
     
    414414    my $channel = "";
    415415    my $body = $m->body;
    416    
     416
    417417    if ($m->is_zephyr) {
    418418        my $inst = $m->instance;
     
    459459    }
    460460    for my $w (@words) {
    461         if (($outline ne "") 
     461        if (($outline ne "")
    462462            && (length($outline)+length($w) > $width-$unindent)) {
    463463            $out .= $outline."\n";
     
    472472        $outline .= $w;
    473473    }
    474     $out .= $outline . "\n";   
    475 }
     474    $out .= $outline . "\n";
     475}
  • examples/owlconf.simple

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22
    33### !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!! !!!!!WARNING!!!!!
    4 ### This is an example file intended to demonstrate how to use 
     4### This is an example file intended to demonstrate how to use
    55### various features of owl.  Some of the key bindings, in particular,
    66### are more for examples than things you may actually want to use.
     
    3636###     $owl::sender, $owl::opcode, $owl::zsig,
    3737###     $owl::msg, $owl::time, $owl::host, @owl::fields, $owl::id
    38 ###   
     38###
    3939
    4040# NOTE: Lines beginning with a "#" are perl comments.
     
    4949    ## Doing "help" will show you more about each variable.
    5050    ## These lines will set things to the default.
    51     ## You can uncomment them and then change the value to get 
     51    ## You can uncomment them and then change the value to get
    5252    ## a different behavior (remove the "#" to an alternate value).
    5353    ################################################################
     
    6060
    6161    ## Set this to on to enable logging of personal zephyrs
    62     # owl::command('set -q logging off'); 
     62    # owl::command('set -q logging off');
    6363
    6464    ## This directory must exist and is where personal zephyrs are logged.
     
    6767
    6868    ## Set this to on to enable logging of classes
    69     # owl::command('set -q classlogging off'); 
     69    # owl::command('set -q classlogging off');
    7070
    7171    ## This directory must exist and is where class zephyrs are logged.
     
    105105    ################################################################
    106106    ## The following create filters.  Filters can be used to select
    107     ## on multiple zephyrs for operations.  With 'views' you can 
     107    ## on multiple zephyrs for operations.  With 'views' you can
    108108    ## look at only the zephyrs matching a particular filter.
    109109    ## Use the 'view <filtername>' command or the 'v' key to switch views.
     
    114114    ## The filter command creates a filter with the specified name,
    115115    ## or if one already exists it is replaced.  Example filter
    116     ## syntax would be:                                       
     116    ## syntax would be:
    117117    ##
    118118    ##    filter myfilter -c red ( class ^foobar$ ) or ( class ^quux$ and instance ^bar$ )
     
    123123    ## is used it specifies the color that messages matching this filter
    124124    ## should be displayed in.  Do 'show colors' to see the available colors.
    125     ## 
     125    ##
    126126    ################################################################
    127127
     
    137137    ## The 'trash' filter is used when you press 'T' to mark things
    138138    ## for autodeletion.
    139     # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$');   
     139    # owl::command('filter trash class ^mail$ or opcode ^ping$ or type ^admin$ or class ^login$');
    140140
    141141}
     
    188188    ## Note that:
    189189    ##   $out .= "foo";  appends "foo" to the end of the variable $out.
    190     ##   lc(bar) will convert bar to lowercase.   
     190    ##   lc(bar) will convert bar to lowercase.
    191191    ##   "ne" does "not equal" for string comparison.
    192192    ##   sprintf fills in the %s's with the arguments later on the line.
     
    213213        # Incoming messages
    214214
    215         $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class), 
     215        $out .= sprintf "[mit,%s,%s] / %s / %s", lc($owl::class),
    216216                        lc($owl::instance), $owl::time, lc($owl::host);
    217217        if ($owl::opcode ne "") {$out.=" op:$owl::opcode";}
     
    228228        }
    229229    }
    230     $out.="\n";         
     230    $out.="\n";
    231231
    232232    # This indents the body of the message and then appends it on.
     
    251251## In most cases you won't need anything here.
    252252sub owl::receive_msg() {
    253    
     253
    254254    ## If this is uncommented, it would mark all messages
    255255    ## with opcode "PING" for immediate deletion:
  • examples/owlconf.vtformat

    rd7cc50b r7869e48  
    1 ### The owlconf config file   -*- perl -*- 
     1### The owlconf config file   -*- perl -*-
    22###
    33### This file is interpreted by the perl interpreter.
     
    2323###     $owl::sender, $owl::opcode, $owl::zsig,
    2424###     $owl::msg, $owl::time, $owl::host, @owl::fields
    25 ###   
     25###
    2626
    2727# classes will be appreviated this way
     
    124124    }
    125125    for my $w (@words) {
    126         if (($outline ne "") 
     126        if (($outline ne "")
    127127            && (length($outline)+length($w) > $width-$unindent)) {
    128128            $out .= $outline."\n";
     
    137137        $outline .= $w;
    138138    }
    139     $out .= $outline . "\n";   
     139    $out .= $outline . "\n";
    140140}
Note: See TracChangeset for help on using the changeset viewer.