[prev] [thread] [next] [lurker] [Date index for 2002/09/12]
Update of /cvsroot/siesta/siesta/lib/Siesta/Storage In directory usw-pr-cvs1:/tmp/cvs-serv17424/lib/Siesta/Storage Modified Files: DBI.pm Log Message: perltidy Index: DBI.pm =================================================================== RCS file: /cvsroot/siesta/siesta/lib/Siesta/Storage/DBI.pm,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- DBI.pm 12 Sep 2002 11:35:51 -0000 1.25 +++ DBI.pm 12 Sep 2002 12:55:31 -0000 1.26 @@ -11,8 +11,8 @@ my $class = shift; my $dbh = DBI->connect(@_); - unless ($dbh) { # busy wait for SQLite - for (1..10) { + unless ($dbh) { # busy wait for SQLite + for ( 1 .. 10 ) { sleep 2; $dbh = DBI->connect(@_) and last; @@ -36,7 +36,7 @@ my %where = %{ $args{where} || {} }; my @columns = @{ $args{columns} }; - my $sql = "SELECT ". join ( ', ', @columns ) ." FROM $args{table}"; + my $sql = "SELECT " . join ( ', ', @columns ) . " FROM $args{table}"; $sql .= join ( '', " WHERE ", @@ -53,11 +53,10 @@ sub get_lists { my $self = shift; - map { Siesta::List->new_from_hash(%$_) } - $self->_get_rows( - table => 'lists', - columns => \@Siesta::List::fields - ); + map { Siesta::List->new_from_hash(%$_) } $self->_get_rows( + table => 'lists', + columns => \@Siesta::List::fields + ); } sub get_users { @@ -73,7 +72,7 @@ my $self = shift; my $user_id = shift; - $user_id = UNIVERSAL::can($user_id, 'id') ? $user_id->id : $user_id; + $user_id = UNIVERSAL::can( $user_id, 'id' ) ? $user_id->id : $user_id; grep { $self->member_of_list( $_->id, $user_id ) } $self->get_lists; } @@ -423,7 +422,7 @@ # if it looks hacky, then that's because it is if ( defined $position ) { - push @plugins, ( $plugin, splice( @plugins, $position-1 ) ); + push @plugins, ( $plugin, splice( @plugins, $position - 1 ) ); } else { push @plugins, $plugin; @@ -455,8 +454,8 @@ foreach my $plugin (@plugins) { my $isql = sprintf "INSERT INTO list_plugins ( id, plugin_id , list_id ) - VALUES (%d, %s, %s )", $a++, $self->_dbh->quote($plugin), - $self->_dbh->quote( $list->id() ); + VALUES (%d, %s, %s )", $a++, + $self->_dbh->quote($plugin), $self->_dbh->quote( $list->id() ); $self->_dbh->do($isql) or die $self->_dbh->errstr;
Generated at 13:57 on 01 Jul 2004 by mariachi 0.52