Skip to content

Commit

Permalink
Clean
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanx749 committed Feb 12, 2024
1 parent c74209c commit 7a3da73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pycdhit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from ._commands import * # noqa: F403
from ._io import * # noqa: F403

VERSION = "0.11.0"
VERSION = "0.12.0"

__all__ = [ # noqa: F405
"CommandBase",
Expand Down
11 changes: 6 additions & 5 deletions pycdhit/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ def _run(command):
raise


def _create_function(name: str, env_var: str):
def _create_function(name: str, func_name: str, env_var: str):
def function(**kwargs) -> subprocess.CompletedProcess:
command = [_format_program(name, os.getenv(env_var))]
command.extend(_format_options(kwargs))
return _run(command)

function.__name__ = func_name
function.__doc__ = f"""Run command {name}.
If environment variable `{env_var}` exists,
Expand All @@ -82,8 +83,8 @@ def function(**kwargs) -> subprocess.CompletedProcess:
return function


for prog, fun in zip(PROGS, functions):
globals()[fun] = _create_function(prog, "CD_HIT_DIR")
for prog, func in zip(PROGS, functions):
globals()[func] = _create_function(prog, func, "CD_HIT_DIR")

for prog, fun in zip(AUXTOOLS, aux_functions):
globals()[fun] = _create_function(prog, "CD_HIT_AUXTOOLS_DIR")
for prog, func in zip(AUXTOOLS, aux_functions):
globals()[func] = _create_function(prog, func, "CD_HIT_AUXTOOLS_DIR")

0 comments on commit 7a3da73

Please sign in to comment.