Remove need for summary argument
This commit is contained in:
parent
8559df502d
commit
b651deae4e
|
@ -1,16 +1,12 @@
|
|||
from borgmanager.database.object import Repo, Archive, Cache
|
||||
from math import floor, pow, log
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
|
||||
class Summary(object):
|
||||
def __init__(self, db, args):
|
||||
def __init__(self, db):
|
||||
self.db = db
|
||||
|
||||
if args == "repo":
|
||||
print(self.print_repo_stats())
|
||||
|
||||
def print_repo_stats(self):
|
||||
def repo_stats(self):
|
||||
repos = self.db.repo_conn.get_all()
|
||||
|
||||
return_string = ""
|
||||
|
|
|
@ -15,8 +15,9 @@ def main(args, path: Path):
|
|||
path = output_path
|
||||
db = BorgDatabase(path / 'borg.sqlite')
|
||||
|
||||
if args.summary is not None:
|
||||
summary = Summary(db, args.summary)
|
||||
if args.summary:
|
||||
summary = Summary(db)
|
||||
print(summary.repo_stats())
|
||||
else:
|
||||
borg_output = " ".join(stdin.readlines())
|
||||
if args.label is None:
|
||||
|
@ -32,7 +33,7 @@ def main(args, path: Path):
|
|||
|
||||
def get_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-s", "--summary", help="Print summary", type=str)
|
||||
parser.add_argument("-s", "--summary", help="Print summary", action='store_true')
|
||||
parser.add_argument("-d", "--dir", help="Database directory", type=str)
|
||||
parser.add_argument("-l", "--label", help="Repo Label", type=str)
|
||||
return parser.parse_args()
|
||||
|
|
Loading…
Reference in New Issue
Block a user