[MOBY-guts] biomoby commit
Frank Gibbons
fgibbons at pub.open-bio.org
Fri Sep 16 16:53:35 UTC 2005
fgibbons
Fri Sep 16 12:53:35 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv23849/MOBY
Modified Files:
Config.pm
Log Message:
- Replace '||' with 'or' for correct behavior when file cannot be opened.
moby-live/Perl/MOBY Config.pm,1.8,1.9
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Config.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/08/02 15:18:00 1.8
+++ /home/repository/moby/moby-live/Perl/MOBY/Config.pm 2005/09/16 16:53:35 1.9
@@ -1,7 +1,6 @@
package MOBY::Config;
-BEGIN {
-}
+BEGIN {}
use strict;
use Carp;
use MOBY::dbConfig;
@@ -15,7 +14,7 @@
#Encapsulated class data
#___________________________________________________________
#ATTRIBUTES
- my %_attr_data = # DEFAULT ACCESSIBILITY
+ my %_attr_data = # DEFAULT ACCESSIBILITY
(
mobycentral => [ undef, 'read/write' ],
mobyobject => [ undef, 'read/write' ],
@@ -47,7 +46,7 @@
}
}
-# the expected sectionons (listed above) will have their dbCOnfig objects available
+# the expected sections (listed above) will have their dbConfig objects available
# as methods. The unexpected sections will have their dbConfig objects available
# by $dbConfig = $CONFIG->{section_title}
sub new {
@@ -70,10 +69,9 @@
( -e $file ) || die "MOBY Configuration file $file doesn't exist $!\n";
chomp $file;
if ( ( -e $file ) && ( !( -d $file ) ) ) {
- open IN,
- $file
- || die
- "can't open MOBY Configuration file $file for unknown reasons$!\n";
+ open IN, $file
+ or die
+ "can't open MOBY Configuration file $file for unknown reasons: $!\n";
}
my @sections = split /(\[\s*\S+\s*\][^\[]*)/s, join "", <IN>;
@@ -97,14 +95,10 @@
sub getDataAdaptor {
my ( $self, %args ) = @_;
- my $source = $args{datasource};
- $source ||= $args{source};
- $source ||= "mobycentral";
+ my $source = $args{datasource} || $args{source} || "mobycentral";
if ( $self->{"${source}Adaptor"} ) { return $self->{"${source}Adaptor"} }
; # read from cache
- my $username =
- $self->$source
- ->{username}; # $self->$source returns a MOBY::dbConfig object
+ my $username = $self->$source->{username};# $self->$source returns a MOBY::dbConfig object
my $password = $self->$source->{password};
my $port = $self->$source->{port};
my $dbname = $self->$source->{dbname};
More information about the MOBY-guts
mailing list