[prev] [thread] [next] [lurker] [Date index for 2002/09/24]
On Tue, Sep 24, 2002 at 12:48:57PM +0100, Simon Batistoni said:
> On the subject of frobbing nacho, I keep suggesting to Simon (and he
> keeps grimacing reluctantly) that some of the stuff that's living in
> nacho's core should really be moved to a module or two.
Apart from some things (which I need to fix) most of what nacho is is
error messages and presentation. For example
sub show_users_list {
my $list_id = shift || die "You must pass a list id to
show_users_list\n";
my $list = Siesta::List->new($list_id) || die "Invalid list id\n";
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;
}
}
# show all lists that a user is on
sub show_lists_user {
my $user_id = shift || die "You must pass a user id to
show_lists_user\n";
my $user = Siesta::User->new($user_id) || die "Invalid user id\n";
print "\nThe user $user_id is on the following lists : \n";
print "----\n";
foreach my $list ( $user->lists ) {
print $list->id, "\n";
}
}
There's not a lot there that can be modularised. I'm not saying that
there's no cruft and code duplication in nacho (for example, adding a
user to a list currently creates a new user if one doesn't exists) this
is duplicated in a couple of places I'm just lacking in refactoring
tuits at the moment (or I would have knocked off Richard's hit list).
> Such a resource might also be useful for coding up a quick email-based
> admin system (and hey, siesta could be the first MLM to be adminnable
> via jabber or an irc bot. yeah! uh...)
Seems like an emminently sensible idea to me :)
Simon
There's stuff above here
Generated at 13:56 on 01 Jul 2004 by mariachi 0.52