Skip to content

Commit

Permalink
Enable repo type update (not supported by TS API yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
nsoranzo committed Aug 12, 2016
1 parent 057f4f0 commit 3ceaa40
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions planemo/shed/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,10 +602,11 @@ def _build_suite_repo(config, repos, suite_config):


def update_repository_for(ctx, tsi, id, repo_config):
# TODO: enforce no "type" change.
from bioblend.galaxy.client import Client
name = repo_config["name"]
description = repo_config.get("description", None)
long_description = repo_config.get("long_description", None)
repo_type = shed_repo_type(repo_config, name)
remote_repository_url = repo_config.get("remote_repository_url", None)
homepage_url = repo_config.get("homepage_url", None)
categories = repo_config.get("categories", [])
Expand All @@ -614,8 +615,9 @@ def update_repository_for(ctx, tsi, id, repo_config):
_ensure_shed_description(description)

kwds = dict(
name=repo_config["name"],
name=name,
synopsis=description,
type=repo_type,
)
if long_description is not None:
kwds["description"] = long_description
Expand Down Expand Up @@ -722,12 +724,13 @@ def path_to_repo_name(path):

def shed_repo_type(config, name):
repo_type = config.get("type", None)
if repo_type is None and name.startswith("package_"):
repo_type = REPO_TYPE_TOOL_DEP
elif repo_type is None and name.startswith("suite_"):
repo_type = REPO_TYPE_SUITE
elif repo_type is None:
repo_type = REPO_TYPE_UNRESTRICTED
if repo_type is None:
if name.startswith("package_"):
repo_type = REPO_TYPE_TOOL_DEP
elif name.startswith("suite_"):
repo_type = REPO_TYPE_SUITE
else:
repo_type = REPO_TYPE_UNRESTRICTED
return repo_type


Expand Down

0 comments on commit 3ceaa40

Please sign in to comment.