Skip to content

Commit

Permalink
Make galaxy_jwd.py compatible with Python 3.6
Browse files Browse the repository at this point in the history
  • Loading branch information
kysrpex committed Jul 7, 2023
1 parent 149f553 commit 7483553
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions roles/usegalaxy-eu.bashrc/files/galaxy_jwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import textwrap
from argparse import RawDescriptionHelpFormatter
from datetime import datetime
from typing import Optional, Tuple
from xml.dom.minidom import parse

import psycopg2
Expand Down Expand Up @@ -55,8 +56,8 @@ def main():
formatter_class=SubcommandHelpFormatter,
)
subparsers = parser.add_subparsers(
dest="operation",
title="operations",
required=True,
help=None,
metavar="",
)
Expand Down Expand Up @@ -177,7 +178,7 @@ def main():
)

# For the get subcommand
if args.subcommand == "get":
if args.operation == "get":
job_id = args.job_id
object_store_id, job_runner_name = db.get_job_info(job_id)
jwd_path = decode_path(
Expand All @@ -195,7 +196,7 @@ def main():
sys.exit(1)

# For the clean subcommand
if args.subcommand == "clean":
if args.operation == "clean":
# Check if the given Galaxy log directory exists
if not os.path.isdir(galaxy_log_dir):
raise ValueError(
Expand Down Expand Up @@ -338,7 +339,7 @@ def decode_path(
job_id: int,
metadata: list,
backends_dict: dict,
job_runner_name: str | None = None,
job_runner_name: Optional[str] = None,
) -> str:
"""Decode the path of JWDs and check if the path exists.
Expand Down Expand Up @@ -466,7 +467,7 @@ def get_failed_jobs(self, days: int) -> dict:

return failed_jobs_dict

def get_job_info(self, job_id: int) -> tuple[str, str]:
def get_job_info(self, job_id: int) -> Tuple[str, str]:
"""Get object_store_id and job_runner_name for a given job id.
Args:
Expand Down

0 comments on commit 7483553

Please sign in to comment.