Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
c2be78de
Commit
c2be78de
authored
12 years ago
by
Andy Yates
Browse files
Options
Downloads
Patches
Plain Diff
Adding a registry version to CliHelper
parent
c4132fd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Utils/CliHelper.pm
+32
-0
32 additions, 0 deletions
modules/Bio/EnsEMBL/Utils/CliHelper.pm
with
32 additions
and
0 deletions
modules/Bio/EnsEMBL/Utils/CliHelper.pm
+
32
−
0
View file @
c2be78de
...
...
@@ -82,6 +82,7 @@ use Carp;
use
Data::
Dumper
;
use
Getopt::
Long
qw(:config auto_version no_ignore_case)
;
use
Bio::EnsEMBL::
Registry
;
use
Bio::EnsEMBL::DBSQL::
DBConnection
;
use
Bio::EnsEMBL::DBSQL::
DBAdaptor
;
...
...
@@ -251,4 +252,35 @@ sub get_dbas_for_opts {
}
return
$dbas
;
}
=head2 load_registry_for_opts
Arg [1] : Hash of options (e.g. parsed from command line options by process_args())
Arg [2] : Optional prefix to use when parsing e.g. dna or master
Description : Loads a Registry from the given options hash. If a C<registry>
option is given then the code will call C<load_all>. Otherwise
we use the database parameters given to call
C<load_registry_from_db()>.
Returntype : Integer of the number of DBAdaptors loaded
Status : Under development
=cut
sub
load_registry_for_opts
{
my
(
$self
,
$opts
,
$prefix
)
=
@_
;
$prefix
||=
q{}
;
if
(
$opts
->
{
registry
})
{
my
$location
=
$opts
->
{
registry
};
return
Bio::EnsEMBL::
Registry
->
load_all
(
$location
);
}
my
(
$host
,
$port
,
$user
,
$pass
)
=
map
{
$prefix
.
$_
}
qw(host port user pass)
;
my
%args
=
(
-
HOST
=>
$opts
->
{
$host
},
-
PORT
=>
$opts
->
{
$port
},
-
USER
=>
$opts
->
{
$user
},
);
$args
{
-
PASS
}
=
$opts
->
{
$pass
};
return
Bio::EnsEMBL::
Registry
->
load_registry_from_db
(
%args
);
}
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment