[prev] [thread] [next] [lurker] [Date index for 2002/09/18]
Update of /cvsroot/siesta/siesta/bin In directory usw-pr-cvs1:/tmp/cvs-serv25859/bin Modified Files: nacho Log Message: lose()->extra()->braces() Index: nacho =================================================================== RCS file: /cvsroot/siesta/siesta/bin/nacho,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- nacho 18 Sep 2002 15:43:24 -0000 1.31 +++ nacho 18 Sep 2002 16:27:12 -0000 1.32 @@ -112,8 +112,8 @@ # show all lists sub show_lists { - foreach my $list ( Siesta->storage->get_lists() ) { - print $list->id() . "\n"; + foreach my $list ( Siesta->storage->get_lists ) { + print $list->id . "\n"; } } @@ -125,9 +125,9 @@ # show all users sub show_users { - foreach my $user ( Siesta->storage->get_users() ) { - printf "%s %s <%s>\n", $user->forename() || '', $user->surname() || '', - $user->id(); + foreach my $user ( Siesta->storage->get_users ) { + printf "%s %s <%s>\n", $user->forename || '', $user->surname || '', + $user->id; } } @@ -145,9 +145,9 @@ print "\nThe list $list_id has the following members : \n"; print "----\n"; - foreach my $user ( $list->members() ) { - printf "%s %s <%s>\n", $user->forename() || "", $user->surname() || "", - $user->id(); + foreach my $user ( $list->members ) { + printf "%s %s <%s>\n", $user->forename || "", $user->surname || "", + $user->id; } } @@ -165,8 +165,8 @@ print "\nThe user $user_id is on the following lists : \n"; print "----\n"; - foreach my $list ( $user->lists() ) { - print $list->id(), "\n"; + foreach my $list ( $user->lists ) { + print $list->id, "\n"; } } @@ -189,7 +189,7 @@ ); my $user = Siesta::User->new_from_hash(%hash); - $user->save() || die "Errk : that failed to save"; + $user->save || die "Errk : that failed to save"; print "User $forename $surname <$user_id> added\n"; } @@ -223,11 +223,11 @@ my $user = Siesta::User->new($user_id) || die "Not a valid user id\n"; - foreach my $list ( Siesta->storage->get_lists() ) { + foreach my $list ( Siesta->storage->get_lists ) { $list->remove_member($user_id); } - $user->delete(); + $user->delete; print "User '$user_id' deleted\n"; } @@ -255,7 +255,7 @@ $user->$key($value); - $user->save() || die "Couldn't modify user $user_id\n"; + $user->save || die "Couldn't modify user $user_id\n"; print "Property '$key' set to '$value' for the user $user_id\n"; } @@ -283,7 +283,7 @@ ) || die "Failed to create a new list\n"; - $list->save() || die "Failed to save the new list"; + $list->save || die "Failed to save the new list"; print "Created the new list '$list_id' <$post_addr>\n"; print "Paste this into your alias file to activate the list\n\n"; @@ -302,11 +302,11 @@ my $list = Siesta::List->new($list_id) or die "Not a valid list id\n"; - foreach my $user ( $list->members() ) { + foreach my $user ( $list->members ) { $list->remove_member($user); } - $list->delete(); + $list->delete; print "List '$list_id' deleted\n"; } @@ -352,7 +352,7 @@ unless $fields{$key}; $list->$key($value); - $list->save() + $list->save or die "Couldn't modify list $list_id\n"; print "Property '$key' set to '$value' for the list $list_id\n"; @@ -372,18 +372,17 @@ ( my $path = $0 ) =~ s!^(.*[\\/]).*$!$1!; - ( my $post = $list->post_address() ) =~ s!@.*$!!; - ( my $ret = $list->return_path() ) =~ s!@.*$!!; + ( my $post = $list->post_address ) =~ s!@.*$!!; + ( my $ret = $list->return_path ) =~ s!@.*$!!; printf "## %s mailing list\n", $list_id; printf "## created: %s nacho (the siesta config tool)\n", strftime( "%d-%b-%Y", localtime(time) ); - printf "%s: \"|%s%s %s\"\n", $post, $path, 'tequila', $list->id(); - printf "%s-sub: \"|%s%s %s sub\"\n", $post, $path, 'tequila', $list->id(); - printf "%s-unsub: \"|%s%s %s unsub\"\n", $post, $path, 'tequila', - $list->id(); - printf "%s-admin: %s\n", $post, $list->owner(); - printf "%s: %s\n\n", $ret, $list->owner(); + printf "%s: \"|%s%s %s\"\n", $post, $path, 'tequila', $list->id; + printf "%s-sub: \"|%s%s %s sub\"\n", $post, $path, 'tequila', $list->id; + printf "%s-unsub: \"|%s%s %s unsub\"\n", $post, $path, 'tequila', $list->id; + printf "%s-admin: %s\n", $post, $list->owner; + printf "%s: %s\n\n", $ret, $list->owner; } @@ -407,7 +406,7 @@ unless ($user) { $user = Siesta::User->new_from_hash( id => $user_id ) or die "Couldn't create a new user\n"; - $user->save(); + $user->save; print "Created a new user '$user_id' - don't forget to set more details for them\n"; } @@ -449,7 +448,7 @@ sub show_all_plugins { print "This system currently has these plugins installed : \n\n"; - foreach my $plugin ( Siesta->list_all_plugins() ) { + foreach my $plugin ( Siesta->list_all_plugins ) { my $class = "Siesta::Plugin::" . $plugin; eval "require $class"; die $@ if $@; @@ -478,7 +477,7 @@ my $a = 1; print "The list $list_id has these plugins activated :\n"; - foreach my $plugin ( $list->plugins() ) { + foreach my $plugin ( $list->plugins ) { print "$a) $plugin\n"; $a++; } @@ -507,7 +506,7 @@ my $a = 1; print "Set the plugins for $list_id to be :\n"; - foreach my $plugin ( $list->plugins() ) { + foreach my $plugin ( $list->plugins ) { print "$a) $plugin\n"; $a++; } @@ -554,9 +553,9 @@ eval "require $class"; die $@ if $@; - my $plugin = $class->new(); + my $plugin = $class->new; - my $options = $plugin->options(); + my $options = $plugin->options; print "\n\nThe plugin $plugin_id has the following options :\n"; foreach my $option ( keys %{$options} ) { @@ -725,7 +724,7 @@ # check to see if it's a valid plugin eval "require $class"; die $@ if $@; - my $plugin = $class->new(); + my $plugin = $class->new; $user_id ||= -1; $list_id ||= -1; @@ -735,7 +734,7 @@ my $list = Siesta::List->new($list_id); # set up a message - my $message = Siesta::Message->new(); + my $message = Siesta::Message->new; $message->user($user); $message->list($list); @@ -754,7 +753,7 @@ print "\n\nThe '$type' options for the plugin $plugin_id :\n"; # loop through all the config options and print them out - foreach my $option ( keys %{ $plugin->options() } ) { + foreach my $option ( keys %{ $plugin->options } ) { my $value = $plugin->config( $message, $option ); $value = ( defined $value ) ? $value : '[ no option set ]'; @@ -772,9 +771,9 @@ # check to see if it's a valid plugin eval "require $class"; die $@ if $@; - my $plugin = $class->new(); + my $plugin = $class->new; - die "That's not a valid option\n" unless $plugin->options()->{$key}; + die "That's not a valid option\n" unless $plugin->options->{$key}; $user_id ||= -1; $list_id ||= -1; @@ -784,7 +783,7 @@ my $list = Siesta::List->new($list_id) || undef; # set up a message - my $message = Siesta::Message->new(); + my $message = Siesta::Message->new; $message->user($user); $message->list($list);
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52