Browse Source

Support --nometa option for copy_one and copy_wildcard

tags/nilmtools-1.4.8
Jim Paris 8 years ago
parent
commit
120bf58b85
2 changed files with 9 additions and 2 deletions
  1. +5
    -2
      nilmtools/copy_one.py
  2. +4
    -0
      nilmtools/copy_wildcard.py

+ 5
- 2
nilmtools/copy_one.py View File

@@ -12,6 +12,8 @@ import sys
def main(argv = None):
f = nilmtools.filter.Filter()
parser = f.setup_parser("Copy a stream")
parser.add_argument('-n', '--nometa', action='store_true',
help="Don't copy or check metadata")

# Parse arguments
try:
@@ -25,8 +27,9 @@ def main(argv = None):
raise SystemExit(1)

# Copy metadata
meta = f.client_src.stream_get_metadata(f.src.path)
f.check_dest_metadata(meta)
if not args.nometa:
meta = f.client_src.stream_get_metadata(f.src.path)
f.check_dest_metadata(meta)

# Copy all rows of data using the faster Numpy interfaces
extractor = NumpyClient(f.src.url).stream_extract_numpy


+ 4
- 0
nilmtools/copy_wildcard.py View File

@@ -16,6 +16,8 @@ def main(argv = None):

Example: %(prog)s -u http://host1/nilmdb -U http://host2/nilmdb /sharon/*
""", skip_paths = True)
parser.add_argument('-n', '--nometa', action='store_true',
help="Don't copy or check metadata")
parser.add_argument("path", action="store", nargs="+",
help='Wildcard paths to copy')
args = parser.parse_args(argv)
@@ -56,6 +58,8 @@ def main(argv = None):
new_argv.extend(["--end", "@" + repr(args.end)])
if args.dry_run:
new_argv.extend(["--dry-run"])
if args.nometa:
new_argv.extend(["--nometa"])
if args.force_metadata:
new_argv.extend(["--force-metadata"])
new_argv.extend([stream[0], stream[0]])


Loading…
Cancel
Save