|
|
@@ -89,7 +89,7 @@ class Filter(object): |
|
|
|
raise Exception("Filter client is in use; make another") |
|
|
|
return self._client_dest |
|
|
|
|
|
|
|
def setup_parser(self, description = "Filter data"): |
|
|
|
def setup_parser(self, description = "Filter data", skip_paths = False): |
|
|
|
parser = argparse.ArgumentParser( |
|
|
|
formatter_class = argparse.RawDescriptionHelpFormatter, |
|
|
|
version = nilmtools.__version__, |
|
|
@@ -113,10 +113,15 @@ class Filter(object): |
|
|
|
metavar="TIME", type=self.arg_time, |
|
|
|
help="Ending timestamp for intervals " |
|
|
|
"(free-form, noninclusive)") |
|
|
|
group.add_argument("srcpath", action="store", |
|
|
|
help="Path of source stream, e.g. /foo/bar") |
|
|
|
group.add_argument("destpath", action="store", |
|
|
|
help="Path of destination stream, e.g. /foo/bar") |
|
|
|
if not skip_paths: |
|
|
|
# Individual filter scripts might want to add these arguments |
|
|
|
# themselves, to include multiple sources in a different order |
|
|
|
# (for example). "srcpath" and "destpath" arguments must exist, |
|
|
|
# though. |
|
|
|
group.add_argument("srcpath", action="store", |
|
|
|
help="Path of source stream, e.g. /foo/bar") |
|
|
|
group.add_argument("destpath", action="store", |
|
|
|
help="Path of destination stream, e.g. /foo/bar") |
|
|
|
self._parser = parser |
|
|
|
return parser |
|
|
|
|
|
|
|