diff --git a/sargraph.py b/sargraph.py index 02bd561..755e5b1 100755 --- a/sargraph.py +++ b/sargraph.py @@ -9,6 +9,8 @@ import argparse import sys import time +import graph +import watch from common import * @@ -37,8 +39,6 @@ if version is None: # If the script was run with no parameters, run in background and gather data if args.session is None: - import watch - # Find requested disk device if args.fspath: args.fspath = os.path.realpath(args.fspath) @@ -104,7 +104,6 @@ elif cmd[0] == 'save': else: send(sid, f"command:s:{cmd[1]}") elif cmd[0] == 'plot': - import graph if len(cmd) < 2: graph.graph(sid) else: diff --git a/watch.py b/watch.py index c377491..fd4908c 100755 --- a/watch.py +++ b/watch.py @@ -16,6 +16,8 @@ import subprocess import sys import time +import graph + from common import * die = 0 @@ -164,10 +166,8 @@ def watch(session, fsdev): if label_line == "none": pass elif label_line: - import graph graph.graph(session, label_line) elif not dont_plot: - import graph graph.graph(session) die = 1 break @@ -177,7 +177,6 @@ def watch(session, fsdev): dont_plot = True if label_line != "none": - import graph summarize(session) if not label_line: graph.graph(session)