Permalink
Browse files

Rename option --galaxy_sqlite_database_option to galaxy_database_seed…

…_option.

This will be more consistent with an option that actually specifies Galaxy's database.
  • Loading branch information...
jmchilton committed Apr 12, 2016
1 parent a078bdc commit f7554d17c7fe5dcb9a3dbf83f70dee1da1315149
Showing with 28 additions and 17 deletions.
  1. +25 −14 planemo/galaxy/config.py
  2. +3 −3 planemo/options.py
@@ -159,22 +159,14 @@ def config_join(*args):
sheds_config_path = _configure_sheds_config_file(
ctx, config_directory, **kwds
)
preseeded_database = True
master_api_key = kwds.get("master_api_key", "test_key")
dependency_dir = os.path.join(config_directory, "deps")
galaxy_sqlite_database = kwds.get("galaxy_sqlite_database", None)
try:
_download_database_template(
galaxy_root,
database_location,
latest=latest_galaxy,
galaxy_sqlite_database=galaxy_sqlite_database,
)
except Exception as e:
print(e)
# No network access - just roll forward from null.
preseeded_database = False

preseeded_database = attempt_database_preseed(
galaxy_root,
database_location,
latest_galaxy=latest_galaxy,
**kwds
)
os.makedirs(shed_tools_path)
server_name = "planemo%d" % random.randint(0, 100000)
port = int(kwds.get("port", 9090))
@@ -381,6 +373,25 @@ def cleanup(self):
shutil.rmtree(self.config_directory)


def attempt_database_preseed(
effective_galaxy_root, database_location, latest_galaxy=False, **kwds
):
preseeded_database = True
galaxy_sqlite_database = kwds.get("galaxy_database_seed", None)
try:
_download_database_template(
effective_galaxy_root,
database_location,
latest=latest_galaxy,
galaxy_sqlite_database=galaxy_sqlite_database,
)
except Exception as e:
print(e)
# No network access - just roll forward from null.
preseeded_database = False
return preseeded_database


def _download_database_template(
galaxy_root,
database_location,
@@ -54,9 +54,9 @@ def galaxy_root_option():
)


def galaxy_sqlite_database_option():
def galaxy_database_seed_option():
return planemo_option(
"--galaxy_sqlite_database",
"--galaxy_database_seed",
default=None,
use_global_config=True,
type=click.Path(exists=True, file_okay=True, resolve_path=True),
@@ -663,7 +663,7 @@ def galaxy_config_options():
def galaxy_target_options():
return _compose(
galaxy_root_option(),
galaxy_sqlite_database_option(),
galaxy_database_seed_option(),
install_galaxy_option(),
galaxy_branch_option(),
galaxy_source_option(),

0 comments on commit f7554d1

Please sign in to comment.