Browse Source

Code formatting (#303).

Dan Helfman 2 months ago
parent
commit
f8eda92379
4 changed files with 13 additions and 8 deletions
  1. 1 3
      borgmatic/borg/check.py
  2. 3 1
      borgmatic/borg/delete.py
  3. 3 1
      borgmatic/borg/transfer.py
  4. 6 3
      borgmatic/config/generate.py

+ 1 - 3
borgmatic/borg/check.py

@@ -180,9 +180,7 @@ def check_archives(
             full_command,
             # The Borg repair option triggers an interactive prompt, which won't work when output is
             # captured. And progress messes with the terminal directly.
-            output_file=(
-                DO_NOT_CAPTURE if check_arguments.repair or progress else None
-            ),
+            output_file=(DO_NOT_CAPTURE if check_arguments.repair or progress else None),
             environment=environment.make_environment(config),
             working_directory=working_directory,
             borg_local_path=local_path,

+ 3 - 1
borgmatic/borg/delete.py

@@ -34,7 +34,9 @@ def make_delete_command(
         + borgmatic.borg.flags.make_flags('umask', config.get('umask'))
         + borgmatic.borg.flags.make_flags('log-json', global_arguments.log_json)
         + borgmatic.borg.flags.make_flags('lock-wait', config.get('lock_wait'))
-        + borgmatic.borg.flags.make_flags('list', delete_arguments.list_archives or config.get('list'))
+        + borgmatic.borg.flags.make_flags(
+            'list', delete_arguments.list_archives or config.get('list')
+        )
         + (
             (('--force',) + (('--force',) if delete_arguments.force >= 2 else ()))
             if delete_arguments.force

+ 3 - 1
borgmatic/borg/transfer.py

@@ -56,7 +56,9 @@ def transfer_archives(
     return execute_command(
         full_command,
         output_log_level=logging.ANSWER,
-        output_file=DO_NOT_CAPTURE if (transfer_arguments.progress or config.get('progress')) else None,
+        output_file=(
+            DO_NOT_CAPTURE if (transfer_arguments.progress or config.get('progress')) else None
+        ),
         environment=environment.make_environment(config),
         working_directory=borgmatic.config.paths.get_working_directory(config),
         borg_local_path=local_path,

+ 6 - 3
borgmatic/config/generate.py

@@ -38,8 +38,9 @@ def schema_to_sample_configuration(schema, source_config=None, level=0, parent_i
 
     if schema_type == 'array' or (isinstance(schema_type, list) and 'array' in schema_type):
         config = ruamel.yaml.comments.CommentedSeq(
-            example if schema['items'].get('type') in SCALAR_SCHEMA_TYPES else
-            [
+            example
+            if schema['items'].get('type') in SCALAR_SCHEMA_TYPES
+            else [
                 schema_to_sample_configuration(
                     schema['items'], source_config, level, parent_is_sequence=True
                 )
@@ -65,7 +66,9 @@ def schema_to_sample_configuration(schema, source_config=None, level=0, parent_i
         add_comments_to_configuration_object(
             config, schema, source_config, indent=indent, skip_first=parent_is_sequence
         )
-    elif isinstance(schema_type, list) and all(element_schema_type in SCALAR_SCHEMA_TYPES for element_schema_type in schema_type):
+    elif isinstance(schema_type, list) and all(
+        element_schema_type in SCALAR_SCHEMA_TYPES for element_schema_type in schema_type
+    ):
         return example
     elif schema_type in SCALAR_SCHEMA_TYPES:
         return example