From 22bf0e981a45e8ad20f12d47b9341f8938271fb9 Mon Sep 17 00:00:00 2001 From: "A. Murat Eren (Meren)" Date: Wed, 23 Aug 2023 14:45:20 +0200 Subject: [PATCH] more developer friendly --- anvio/argparse.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/anvio/argparse.py b/anvio/argparse.py index fa698a0d05..f39ef4082a 100755 --- a/anvio/argparse.py +++ b/anvio/argparse.py @@ -47,14 +47,20 @@ def __init__(self, description="No description :/", epilog=None): def get_anvio_epilogue(self): """Function that formats the additional message that appears at the end of help.""" + # Here we intend to collect the requires and provides statements from anvi'o programs. + # but the recovery of this 'epilogue' will yield an error for scripts that are not listed + # in the $PATH, which can happen during the earlier stages of program development. so, + # if we can't recover the epilogue, we go long hair don't care and return none. + try: + epilog = self.get_requires_and_provides_statements_for_program() + except: + return None + version = anvio.anvio_version_for_help_docs general_help = f"https://merenlab.org/software/anvio/help/{version}" program_help = f"{general_help}/programs/{self.prog}" - # starting with the requires / provides statements - epilog = self.get_requires_and_provides_statements_for_program() - if os.path.exists(os.path.join(os.path.dirname(docs.__file__), f"programs/{self.prog}.md")): if atty: epilog += f'''\n🍺 {attr('bold')}More on `{self.prog}`:{attr('reset')}\n\n {fg('cyan') + program_help + attr('reset')}'''