Total Complexity | 2 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | #!/usr/bin/env python3 |
||
|
|||
2 | # -*- coding: future_fstrings -*- |
||
3 | |||
4 | from lighthouse_garden.utility import info, system |
||
5 | from lighthouse_garden.lighthouse import process |
||
6 | from lighthouse_garden.export import render |
||
7 | |||
8 | |||
9 | class Lighthouse: |
||
10 | """ |
||
11 | Fetch lighthouse performance data. |
||
12 | """ |
||
13 | def __init__(self, |
||
14 | config_file=None, |
||
15 | verbose=False, |
||
16 | clear=False, |
||
17 | config={} |
||
18 | ): |
||
19 | """ |
||
20 | Initialization |
||
21 | :param config_file: String |
||
22 | :param verbose: Boolean |
||
23 | :param clear: Boolean |
||
24 | :param config: |
||
25 | """ |
||
26 | info.print_header() |
||
27 | system.check_args(config_file=config_file, |
||
28 | verbose=verbose) |
||
29 | system.check_config(config) |
||
30 | if not clear: |
||
31 | system.check_lighthouse_version() |
||
32 | process.fetch_data() |
||
33 | render.generate_dashboard() |
||
34 | info.print_footer() |
||
35 | else: |
||
36 | system.clear_data() |
||
37 | |||
38 |