-
Notifications
You must be signed in to change notification settings - Fork 0
/
raspi.py
55 lines (46 loc) · 1.81 KB
/
raspi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
"""
Start Main Routine for Raspberry Check
@author: Gérard Fischer, CH-5103 Wildegg
only tested with Python 3.7 or later
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA.
"""
import argparse
import platform
from raspicheck import RaspiCheck
try:
from raspianalyse import plot_pdf
PDF = True
except ImportError:
PDF = False
__version__ = '0.1.5'
PATH = 'data/'
pversion = platform.python_version().replace('.', '')
if int(pversion) < 7:
raise ValueError('requires at least python 3.7')
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description='Monitor CPU parameters with changing CPU load')
parser.add_argument('setup', nargs='*', default=[''],
help='a string describing test setup')
parser.add_argument('-t', '--timeout', type=int,
default=600, metavar='',
help='runtime of tests - timeout in seconds')
args = parser.parse_args()
setup = ' '.join(args.setup)
timeout = args.timeout
rcheck = RaspiCheck(setup, timeout, path=PATH)
ffname = rcheck.main()
if PDF:
plot_pdf(ffname)