diff --git a/README.rst b/README.rst index 72be062d..570c6dcf 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,8 @@ Or with the Arrow client: History ------- +- 4.2.8 + - Added --suppress_output to update_organism - 4.2.7 - Renamed --return_all option to --suppress_output - 4.2.6 diff --git a/apollo/organisms/__init__.py b/apollo/organisms/__init__.py index 64606675..a9cb1446 100644 --- a/apollo/organisms/__init__.py +++ b/apollo/organisms/__init__.py @@ -74,7 +74,7 @@ def add_organism(self, common_name, directory, blatdb=None, genus=None, return data def update_organism(self, organism_id, common_name, directory, blatdb=None, species=None, genus=None, public=False, - no_reload_sequences=False): + no_reload_sequences=False, suppress_output=False): """ Update an organism @@ -102,6 +102,9 @@ def update_organism(self, organism_id, common_name, directory, blatdb=None, spec :type no_reload_sequences: bool :param no_reload_sequences: Set this if you don't want Apollo to reload genome sequences (no change in genome sequence) + :type suppress_output: bool + :param suppress_output: Suppress output of all organisms (true / false) (default false) + :rtype: dict :return: a dictionary with information about the updated organism """ @@ -119,6 +122,8 @@ def update_organism(self, organism_id, common_name, directory, blatdb=None, spec data['genus'] = genus if species is not None: data['species'] = species + if suppress_output is not None and suppress_output is True: + data['returnAllOrganisms'] = False response = self.post('updateOrganismInfo', data)[0] diff --git a/arrow/commands/organisms/update_organism.py b/arrow/commands/organisms/update_organism.py index 34ed2548..1b98962a 100644 --- a/arrow/commands/organisms/update_organism.py +++ b/arrow/commands/organisms/update_organism.py @@ -32,14 +32,19 @@ help="Set this if you don't want Apollo to reload genome sequences (no change in genome sequence)", is_flag=True ) +@click.option( + "--suppress_output", + help="Suppress output of all organisms (true / false) (default false)", + is_flag=True +) @pass_context @custom_exception @dict_output -def cli(ctx, organism_id, common_name, directory, blatdb="", species="", genus="", public=False, no_reload_sequences=False): +def cli(ctx, organism_id, common_name, directory, blatdb="", species="", genus="", public=False, no_reload_sequences=False, suppress_output=False): """Update an organism Output: a dictionary with information about the updated organism """ - return ctx.gi.organisms.update_organism(organism_id, common_name, directory, blatdb=blatdb, species=species, genus=genus, public=public, no_reload_sequences=no_reload_sequences) + return ctx.gi.organisms.update_organism(organism_id, common_name, directory, blatdb=blatdb, species=species, genus=genus, public=public, no_reload_sequences=no_reload_sequences, suppress_output=suppress_output) diff --git a/docs/commands/organisms.rst b/docs/commands/organisms.rst index 3de061ec..21817725 100644 --- a/docs/commands/organisms.rst +++ b/docs/commands/organisms.rst @@ -228,5 +228,8 @@ Update an organism --no_reload_sequences Set this if you don't want Apollo to reload genome sequences (no change in genome sequence) + --suppress_output Suppress output of all organisms (true / false) + (default false) + -h, --help Show this message and exit. diff --git a/setup.py b/setup.py index 93992fa9..704e5975 100644 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name="apollo", - version='4.2.7', + version='4.2.8', description="Apollo API library", long_description=readme, author="Helena Rasche;Anthony Bretaudeau;Nathan Dunn",