Changeset b120bd3
- Timestamp:
- Sep 25, 2010, 5:58:38 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- c8d9f84
- Parents:
- 118c919
- git-author:
- Kevin Riggle <kevinr@free-dissociation.com> (09/21/10 00:33:56)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (09/25/10 17:58:38)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
perl/lib/BarnOwl.pm
r675a998 rb120bd3 561 561 } 562 562 563 =head3 random_zephyr_signature 564 565 Retrieve a random line from ~/.zsigs (except those beginning with '#') 566 and use it as the zephyr signature. 567 568 =cut 569 570 sub random_zephyr_signature 571 { 572 my $zsigfile = "$ENV{'HOME'}/.zsigs"; 573 open my $file, '<', $zsigfile or die "Error opening file $zsigfile: $!"; 574 my @lines = grep !(/^#/ || /^\s*$/), <$file>; 575 close $file; 576 return '' if !@lines; 577 my $zsig = "$lines[int(rand(scalar @lines))]"; 578 chomp $zsig; 579 return $zsig; 580 } 581 563 582 # Stub for owl::startup / BarnOwl::startup, so it isn't bound to the 564 583 # startup command. This may be redefined in a user's configfile. -
variable.c
re488ec5 rb120bd3 214 214 "Called every time you start a zephyrgram without an\n" 215 215 "explicit zsig. The default setting implements the policy\n" 216 "described in the documentation for the 'zsig' variable.\n"), 216 "described in the documentation for the 'zsig' variable.\n" 217 "See also BarnOwl::random_zephyr_signature().\n"), 217 218 218 219 OWLVAR_STRING( "zsig" /* %OwlVarStub */, "",
Note: See TracChangeset
for help on using the changeset viewer.