Commit c7d741ee authored by Leo Gordon's avatar Leo Gordon
Browse files

making Registry code optional (require instead of use everywhere)

parent 1861c5c4
......@@ -61,7 +61,6 @@ use strict;
use warnings;
use Bio::EnsEMBL::ApiVersion ();
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Hive::Utils::URL;
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
......@@ -450,7 +449,6 @@ sub run {
}
}
Bio::EnsEMBL::Registry->no_version_check(1);
my $hive_dba = Bio::EnsEMBL::Hive::DBSQL::DBAdaptor->new( -url => $pipeline_url, -no_sql_schema_version_check => 1 );
my $resource_class_adaptor = $hive_dba->get_ResourceClassAdaptor;
......
......@@ -99,7 +99,6 @@ package Bio::EnsEMBL::Hive::Process;
use strict;
use warnings;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Utils::Exception ('throw');
use Bio::EnsEMBL::Hive::DBSQL::DBConnection;
......
......@@ -313,6 +313,7 @@ sub go_figure_dbc {
my $dba;
eval {
$schema_type ||= 'hive';
require Bio::EnsEMBL::Registry;
$dba = Bio::EnsEMBL::Registry->get_DBAdaptor($foo, $schema_type);
};
if(UNIVERSAL::can($dba, 'dbc')) {
......
......@@ -25,7 +25,6 @@ main();
sub main {
$| = 1;
Bio::EnsEMBL::Registry->no_version_check(1);
# ok this is a hack, but I'm going to pretend I've got an object here
# by creating a hash ref and passing it around like an object
......
......@@ -12,7 +12,6 @@ BEGIN {
}
use Getopt::Long;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Hive::Utils::URL;
use Bio::EnsEMBL::Hive::Utils ('script_usage');
......@@ -43,6 +42,8 @@ sub main {
} elsif($reg_alias) {
script_usage(1) if $url;
require Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_all($reg_conf);
my $species = Bio::EnsEMBL::Registry->get_alias($reg_alias)
......
......@@ -13,7 +13,6 @@ BEGIN {
use Getopt::Long;
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::DBSQL::AnalysisJobAdaptor;
use Bio::EnsEMBL::Hive::Utils ('script_usage');
......
......@@ -14,13 +14,10 @@ BEGIN {
use Getopt::Long;
use Bio::EnsEMBL::Hive::Utils ('script_usage');
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Hive::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Hive::Queen;
use Bio::EnsEMBL::Hive::Valley;
Bio::EnsEMBL::Registry->no_version_check(1);
my ($url, $reg_conf, $reg_type, $reg_alias, $nosqlvc); # Connection parameters
my ($resource_class_id, $resource_class_name, $analysis_id, $logic_name, $job_id, $force); # Task specification parameters
my ($job_limit, $life_span, $no_cleanup, $no_write, $hive_log_dir, $worker_log_dir, $retry_throwing_jobs, $can_respecialize); # Worker control parameters
......@@ -60,10 +57,6 @@ GetOptions(
if ($help) { script_usage(0); }
if($reg_conf) { # if reg_conf is defined, we load it regardless of whether it is used to connect to the Hive database or not:
Bio::EnsEMBL::Registry->load_all($reg_conf);
}
my $hive_dba;
if($url or $reg_alias) {
......
......@@ -13,7 +13,6 @@ BEGIN {
use Getopt::Long qw(:config pass_through);
use Bio::EnsEMBL::Registry;
use Bio::EnsEMBL::Hive::Process;
use Bio::EnsEMBL::Hive::AnalysisJob;
use Bio::EnsEMBL::Hive::Utils ('script_usage', 'load_file_or_module', 'parse_cmdline_options', 'stringify', 'destringify');
......@@ -39,6 +38,7 @@ if ($help or !$module_or_file) {
my $runnable_module = load_file_or_module( $module_or_file );
if($reg_conf) {
require Bio::EnsEMBL::Registry;
Bio::EnsEMBL::Registry->load_all($reg_conf);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment