Move output handler to borg package
This commit is contained in:
parent
b49be0c0ba
commit
3b7405fe9c
|
@ -2,3 +2,4 @@ from .repo import Repo
|
||||||
from .archive import Archive
|
from .archive import Archive
|
||||||
from .stats import Stats
|
from .stats import Stats
|
||||||
from .error import Error
|
from .error import Error
|
||||||
|
from .outputhandler import OutputHandler
|
||||||
|
|
|
@ -3,7 +3,7 @@ from borgmanager import borg
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
class BorgOutputHandler(object):
|
class OutputHandler(object):
|
||||||
def __init__(self, borg_output: str):
|
def __init__(self, borg_output: str):
|
||||||
self.borg_output = borg_output
|
self.borg_output = borg_output
|
||||||
self.borg_json = None
|
self.borg_json = None
|
|
@ -3,7 +3,7 @@ from sys import stdin
|
||||||
from os.path import realpath
|
from os.path import realpath
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import argparse
|
import argparse
|
||||||
from borgoutputhandler import BorgOutputHandler
|
from borgmanager.borg import OutputHandler
|
||||||
from borgmanager.summary import Summary
|
from borgmanager.summary import Summary
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ def main(args, path: Path):
|
||||||
summary = Summary(db, args.summary)
|
summary = Summary(db, args.summary)
|
||||||
else:
|
else:
|
||||||
borg_output = " ".join(stdin.readlines())
|
borg_output = " ".join(stdin.readlines())
|
||||||
bo = BorgOutputHandler(borg_output)
|
bo = OutputHandler(borg_output)
|
||||||
|
|
||||||
if bo.error:
|
if bo.error:
|
||||||
db.insert_error(bo.get_borg_error())
|
db.insert_error(bo.get_borg_error())
|
||||||
|
|
Loading…
Reference in New Issue
Block a user