Explorar o código

ArchiveFormatter: add "start" key for compatibility with "info"

Marian Beermann %!s(int64=8) %!d(string=hai) anos
pai
achega
8e1edaf258
Modificáronse 2 ficheiros con 6 adicións e 5 borrados
  1. 5 5
      docs/internals/frontends.rst
  2. 1 0
      src/borg/helpers.py

+ 5 - 5
docs/internals/frontends.rst

@@ -173,12 +173,11 @@ Example *borg info* output::
 array under the *archives* key, while :ref:`borg_create` returns a single archive object under the
 array under the *archives* key, while :ref:`borg_create` returns a single archive object under the
 *archive* key.
 *archive* key.
 
 
-Both formats contain a *name* key with the archive name, and the *id* key with the hexadecimal archive ID.
+Both formats contain a *name* key with the archive name, the *id* key with the hexadecimal archive ID,
+and the *start* key with the start timestamp.
 
 
- info and create further have:
+info and create further have:
 
 
-start
-    Start timestamp
 end
 end
     End timestamp
     End timestamp
 duration
 duration
@@ -222,7 +221,8 @@ Example of a simple archive listing (``borg list --last 1 --json``)::
                 "barchive": "2017-02-27T21:21:51",
                 "barchive": "2017-02-27T21:21:51",
                 "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a",
                 "id": "80cd07219ad725b3c5f665c1dcf119435c4dee1647a560ecac30f8d40221a46a",
                 "name": "2017-02-27T21:21:51",
                 "name": "2017-02-27T21:21:51",
-                "time": "Mon, 2017-02-27 21:21:52"
+                "time": "Mon, 2017-02-27 21:21:52",
+                "start": "Mon, 2017-02-27 21:21:52"
             }
             }
         ],
         ],
         "encryption": {
         "encryption": {

+ 1 - 0
src/borg/helpers.py

@@ -1622,6 +1622,7 @@ class ArchiveFormatter(BaseFormatter):
             'archive': remove_surrogates(archive.name),
             'archive': remove_surrogates(archive.name),
             'id': bin_to_hex(archive.id),
             'id': bin_to_hex(archive.id),
             'time': format_time(to_localtime(archive.ts)),
             'time': format_time(to_localtime(archive.ts)),
+            'start': format_time(to_localtime(archive.ts)),
         }
         }
 
 
     @staticmethod
     @staticmethod