Browse Source

Fix nilm-decimate-auto for Python 3

tags/nilmtools-2.0.0
Jim Paris 1 year ago
parent
commit
bef2054357
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      nilmtools/decimate_auto.py

+ 5
- 3
nilmtools/decimate_auto.py View File

@@ -1,5 +1,6 @@
#!/usr/bin/python

import os
import nilmtools.filter
import nilmtools.decimate
import nilmdb.client
@@ -9,7 +10,6 @@ import fnmatch
def main(argv = None):
parser = argparse.ArgumentParser(
formatter_class = argparse.RawDescriptionHelpFormatter,
version = nilmtools.__version__,
description = """\
Automatically create multiple decimations from a single source
stream, continuing until the last decimated level contains fewer
@@ -18,8 +18,8 @@ def main(argv = None):
Wildcards and multiple paths are accepted. Decimated paths are
ignored when matching wildcards.
""")
parser.add_argument("-u", "--url", action="store",
default="http://localhost/nilmdb/",
def_url = os.environ.get("NILMDB_URL", "http://localhost/nilmdb/")
parser.add_argument("-u", "--url", action="store", default=def_url,
help="NilmDB server URL (default: %(default)s)")
parser.add_argument("-f", "--factor", action="store", default=4, type=int,
help='Decimation factor (default: %(default)s)')
@@ -27,6 +27,8 @@ def main(argv = None):
default = False,
help="Force metadata changes if the dest "
"doesn't match")
parser.add_argument("-v", "--version", action="version",
version=nilmtools.__version__)
parser.add_argument("path", action="store", nargs='+',
help='Path of base stream')
args = parser.parse_args(argv)


Loading…
Cancel
Save