|
31 | 31 | download_project_finalize, |
32 | 32 | download_project_is_running, |
33 | 33 | ) |
34 | | -from mergin.client_pull import pull_project_async, pull_project_is_running, pull_project_finalize, \ |
35 | | - pull_project_cancel |
36 | | -from mergin.client_push import push_project_async, push_project_is_running, push_project_finalize, \ |
37 | | - push_project_cancel |
| 34 | +from mergin.client_pull import pull_project_async, pull_project_is_running, pull_project_finalize, pull_project_cancel |
| 35 | +from mergin.client_push import push_project_async, push_project_is_running, push_project_finalize, push_project_cancel |
38 | 36 |
|
39 | 37 |
|
40 | 38 | from pygeodiff import GeoDiff |
@@ -143,7 +141,9 @@ def _print_unhandled_exception(): |
143 | 141 | click.echo(line) |
144 | 142 |
|
145 | 143 |
|
146 | | -@click.group(epilog=f"Copyright (C) 2019-2021 Lutra Consulting\n\n(mergin-py-client v{__version__} / pygeodiff v{GeoDiff().version()})") |
| 144 | +@click.group( |
| 145 | + epilog=f"Copyright (C) 2019-2021 Lutra Consulting\n\n(mergin-py-client v{__version__} / pygeodiff v{GeoDiff().version()})" |
| 146 | +) |
147 | 147 | @click.option( |
148 | 148 | "--url", |
149 | 149 | envvar="MERGIN_URL", |
@@ -183,9 +183,12 @@ def login(ctx): |
183 | 183 | @cli.command() |
184 | 184 | @click.argument("project") |
185 | 185 | @click.option("--public", is_flag=True, default=False, help="Public project, visible to everyone") |
186 | | -@click.option("--from-dir", default=None, |
187 | | - help="Content of the directory will be uploaded to the newly created project. " |
188 | | - "The directory will get assigned to the project.") |
| 186 | +@click.option( |
| 187 | + "--from-dir", |
| 188 | + default=None, |
| 189 | + help="Content of the directory will be uploaded to the newly created project. " |
| 190 | + "The directory will get assigned to the project.", |
| 191 | +) |
189 | 192 | @click.pass_context |
190 | 193 | def create(ctx, project, public, from_dir): |
191 | 194 | """Create a new project on Mergin Maps server. `project` needs to be a combination of namespace/project.""" |
@@ -234,29 +237,24 @@ def create(ctx, project, public, from_dir): |
234 | 237 | @click.option( |
235 | 238 | "--order_params", |
236 | 239 | help="optional attributes for sorting the list. " |
237 | | - "It should be a comma separated attribute names " |
238 | | - "with _asc or _desc appended for sorting direction. " |
239 | | - "For example: \"namespace_asc,disk_usage_desc\". " |
240 | | - "Available attrs: namespace, name, created, updated, disk_usage, creator", |
| 240 | + "It should be a comma separated attribute names " |
| 241 | + "with _asc or _desc appended for sorting direction. " |
| 242 | + 'For example: "namespace_asc,disk_usage_desc". ' |
| 243 | + "Available attrs: namespace, name, created, updated, disk_usage, creator", |
241 | 244 | ) |
242 | 245 | @click.pass_context |
243 | 246 | def list_projects(ctx, flag, name, namespace, order_params): |
244 | 247 | """List projects on the server.""" |
245 | 248 | filter_str = "(filter flag={})".format(flag) if flag is not None else "(all public)" |
246 | | - |
| 249 | + |
247 | 250 | click.echo("List of projects {}:".format(filter_str)) |
248 | 251 |
|
249 | 252 | mc = ctx.obj["client"] |
250 | 253 | if mc is None: |
251 | 254 | return |
252 | 255 |
|
253 | | - projects_list = mc.projects_list( |
254 | | - flag=flag, |
255 | | - name=name, |
256 | | - namespace=namespace, |
257 | | - order_params=order_params |
258 | | - ) |
259 | | - |
| 256 | + projects_list = mc.projects_list(flag=flag, name=name, namespace=namespace, order_params=order_params) |
| 257 | + |
260 | 258 | click.echo("Fetched {} projects .".format(len(projects_list))) |
261 | 259 | for project in projects_list: |
262 | 260 | full_name = "{} / {}".format(project["namespace"], project["name"]) |
@@ -401,9 +399,12 @@ def status(ctx): |
401 | 399 | return |
402 | 400 |
|
403 | 401 | if mc.has_unfinished_pull(os.getcwd()): |
404 | | - click.secho("The previous pull has not finished completely: status " |
405 | | - "of some files may be reported incorrectly. Use " |
406 | | - "resolve_unfinished_pull command to try to fix that.", fg="yellow") |
| 402 | + click.secho( |
| 403 | + "The previous pull has not finished completely: status " |
| 404 | + "of some files may be reported incorrectly. Use " |
| 405 | + "resolve_unfinished_pull command to try to fix that.", |
| 406 | + fg="yellow", |
| 407 | + ) |
407 | 408 |
|
408 | 409 | click.secho("### Server changes:", fg="magenta") |
409 | 410 | pretty_diff(pull_changes) |
@@ -526,7 +527,7 @@ def show_file_history(ctx, path): |
526 | 527 | @click.argument("version") |
527 | 528 | @click.pass_context |
528 | 529 | def show_file_changeset(ctx, path, version): |
529 | | - """ Displays information about project changes.""" |
| 530 | + """Displays information about project changes.""" |
530 | 531 | mc = ctx.obj["client"] |
531 | 532 | if mc is None: |
532 | 533 | return |
|
0 commit comments