Skip to content

Commit 3ad0762

Browse files
committed
skip directories when uploading a glob, rename filter to jobfilter
1 parent e6fc6db commit 3ad0762

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/bma_cli/bma_cli.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ def fileinfo(file_uuid: uuid.UUID) -> None:
4545

4646

4747
@app.command()
48-
def jobs(filter: str = "?limit=0&finished=false") -> None: # noqa: A002
48+
def jobs(jobfilter: str = "?limit=0&finished=false") -> None:
4949
"""Get info on unfinished jobs."""
5050
client, config = init()
51-
jobs = client.get_jobs(job_filter=filter)
51+
jobs = client.get_jobs(job_filter=jobfilter)
5252
click.echo(json.dumps(jobs))
5353
click.echo(f"Total {len(jobs)} jobs returned by filter {filter}.", err=True)
5454

@@ -107,6 +107,8 @@ def upload(files: list[str]) -> None:
107107
file_uuids = []
108108
for f in files:
109109
pf = Path(f)
110+
if pf.is_dir():
111+
continue
110112
click.echo(f"Uploading file {f}...")
111113
result = client.upload_file(path=pf, file_license=config["license"], attribution=config["attribution"])
112114
metadata = result["bma_response"]
@@ -124,7 +126,7 @@ def upload(files: list[str]) -> None:
124126

125127
@app.command()
126128
def exif(path: Path) -> None:
127-
"""Get and return exif for a file."""
129+
"""Get and return exif for a local file."""
128130
client, config = init()
129131
click.echo(json.dumps(client.get_exif(fname=path)))
130132

0 commit comments

Comments
 (0)