Browse Source

Add skip_paths option to filter.setup_parser

tags/nilmtools-1.0
Jim Paris 11 years ago
parent
commit
56e778df71
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      src/filter.py

+ 10
- 5
src/filter.py View File

@@ -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



Loading…
Cancel
Save