Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
# Fix end of files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand All @@ -12,7 +12,7 @@ repos:
# Lint and format
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.3
rev: v0.13.0
hooks:
# Run the linter.
- id: ruff
Expand All @@ -23,7 +23,7 @@ repos:

# Static type-checking with mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.2'
rev: 'v1.18.1'
hooks:
- id: mypy
additional_dependencies: [types-requests]
Expand Down
20 changes: 10 additions & 10 deletions qfieldcloud_sdk/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,14 @@ def login(ctx: Context, username, password) -> None:
print_json(user_data)
else:
log(f"Log in {username}…")
log(f'Welcome to QFieldCloud, {user_data["username"]}.')
log(f"Welcome to QFieldCloud, {user_data['username']}.")
log(
"QFieldCloud has generated a secret token to identify you. "
"Put the token in your in the environment using the following code, "
"so you do not need to write your username and password again:"
)
if platform.system() == "Windows":
log(f'set QFIELDCLOUD_TOKEN={user_data["token"]}')
log(f"set QFIELDCLOUD_TOKEN={user_data['token']}")
else:
log(f'export QFIELDCLOUD_TOKEN="{user_data["token"]}"')

Expand Down Expand Up @@ -264,7 +264,7 @@ def list_files(ctx: Context, project_id, skip_metadata):
if files:
log(f'Files for project "{project_id}":')
for file in files:
log(f'{file["last_modified"]}\t{file["name"]}')
log(f"{file['last_modified']}\t{file['name']}")
else:
log(f'No files within project "{project_id}"')

Expand Down Expand Up @@ -545,7 +545,7 @@ def job_status(ctx: Context, job_id):
print_json(status)
else:
log(f'Getting job "{job_id}" status…')
log(f'Job status for {job_id}: {status["status"]}')
log(f"Job status for {job_id}: {status['status']}")


@cli.command(short_help="Push a delta file to a project.")
Expand Down Expand Up @@ -576,7 +576,7 @@ def package_latest(ctx: Context, project_id):
print_json(status)
else:
log(f'Getting the latest project "{project_id}" package info…')
log(f'Packaging status for {project_id}: {status["status"]}')
log(f"Packaging status for {project_id}: {status['status']}")
if status["layers"] is None:
if status["status"] == "failed":
log("Packaging have never been triggered on this project. Please run:")
Expand Down Expand Up @@ -634,7 +634,7 @@ def package_download(
if files:
log(f"Download status of packaged files in project {project_id}:")
for file in files:
log(f'{file["status"].value}\t{file["name"]}')
log(f"{file['status'].value}\t{file['name']}")
else:
if filter_glob:
log(
Expand All @@ -656,7 +656,7 @@ def collaborators_get(ctx: Context, project_id: str) -> None:
else:
log(f'Collaborators for project with id "{project_id}":')
for collaborator in collaborators:
log(f'{collaborator["collaborator"]}\t{collaborator["role"]}')
log(f"{collaborator['collaborator']}\t{collaborator['role']}")


@cli.command(short_help="Add a project collaborator.")
Expand Down Expand Up @@ -725,7 +725,7 @@ def members_get(ctx: Context, organization: str) -> None:
else:
log(f'Members of organization "{organization}":')
for membership in memberships:
log(f'{membership["member"]}\t{membership["role"]}')
log(f"{membership['member']}\t{membership['role']}")


@cli.command(short_help="Add an organization member.")
Expand Down Expand Up @@ -799,7 +799,7 @@ def teams_list(ctx: Context, organization: str) -> None:
else:
log(f'Teams members in organization "{organization}":')
for object_team in teams_list:
log(f'{object_team["team"]}')
log(f"{object_team['team']}")


@cli.command(name="teams-create", short_help="Create an organization team.")
Expand Down Expand Up @@ -830,7 +830,7 @@ def teams_get(ctx: Context, organization: str, team_name: str) -> None:
log(
f'Team "{object_team["team"]}" in organization "{object_team["organization"]}":'
)
log(f' Members: {", ".join(object_team["members"])}')
log(f" Members: {', '.join(object_team['members'])}")


@cli.command(name="teams-patch", short_help="Rename an organization team.")
Expand Down
6 changes: 3 additions & 3 deletions qfieldcloud_sdk/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ def delete_files(
try:
resp = self._request(
"DELETE",
f'files/{project_id}/{file["name"]}',
f"files/{project_id}/{file['name']}",
stream=True,
)
file["status"] = FileTransferStatus.SUCCESS
Expand Down Expand Up @@ -947,7 +947,7 @@ def delete_files(
files_failed = 0
for files in glob_results.values():
for file in files:
log(f'{file["status"]}\t{file["name"]}')
log(f"{file['status']}\t{file['name']}")

if file["status"] == FileTransferStatus.SUCCESS:
files_deleted += 1
Expand Down Expand Up @@ -1099,7 +1099,7 @@ def download_files(
files_to_download.append(file)

for file in files_to_download:
local_filename = Path(f'{local_dir}/{file["name"]}')
local_filename = Path(f"{local_dir}/{file['name']}")
etag = None
if not force_download:
etag = file.get("etag", None)
Expand Down