1 from bugzilla
import Bugzilla
4 from budget_sync
.util
import all_bugs
5 from budget_sync
.config
import Config
, ConfigParseError
6 from budget_sync
.budget_graph
import BudgetGraph
, BudgetGraphBaseError
9 BUGZILLA_URL
= "https://bugs.libre-soc.org"
13 parser
= argparse
.ArgumentParser(
14 description
="Check for errors in "
15 "Libre-SOC's style of budget tracking in Bugzilla.")
17 "-c", "--config", type=argparse
.FileType('r'),
18 required
=True, help="The path to the configuration TOML file",
19 dest
="config", metavar
="<path/to/budget-sync-config.toml>")
20 args
= parser
.parse_args()
22 with args
.config
as config_file
:
23 config
= Config
.from_file(config_file
)
24 except (IOError, ConfigParseError
) as e
:
25 logging
.error("Failed to parse config file: %s", e
)
27 logging
.info("Using Bugzilla instance at %s", config
.bugzilla_url
)
28 bz
= Bugzilla(config
.bugzilla_url
)
29 logging
.debug("Connected to Bugzilla")
30 budget_graph
= BudgetGraph(all_bugs(bz
), config
)
31 for error
in budget_graph
.get_errors():
32 logging
.error("%s", error
)
35 if __name__
== "__main__":