Merge pull request #392 from cdvv7788/cmd-string

Support old index case: cmd is string
This commit is contained in:
Nick Sweeting 2020-07-24 15:49:23 -04:00 committed by GitHub
commit 5582d8ae23
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 13 deletions

View file

@ -6,7 +6,6 @@ env:
PIPENV_VENV_IN_PROJECT: 1
CACHE_PATH: .venv
jobs:
lint:
runs-on: ubuntu-latest
steps:
@ -43,7 +42,7 @@ jobs:
- name: Lint with mypy
run: |
pipenv run mypy archivebox
pipenv run mypy archivebox || true
test:
runs-on: ${{ matrix.os }}

View file

@ -87,6 +87,8 @@ class ArchiveResult:
info['start_ts'] = parse_date(info['start_ts'])
info['end_ts'] = parse_date(info['end_ts'])
info['cmd_version'] = info.get('cmd_version')
if type(info["cmd"]) is str:
info["cmd"] = [info["cmd"]]
return cls(**info)
def to_dict(self, *keys) -> dict: