Compare commits
1 Commits
nilmtools-
...
nilmtools-
Author | SHA1 | Date | |
---|---|---|---|
a4d4bc22fc |
4
Makefile
4
Makefile
@@ -8,7 +8,7 @@ else
|
|||||||
@echo "Try 'make install'"
|
@echo "Try 'make install'"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test: test_pipewatch
|
test: test_insert
|
||||||
|
|
||||||
test_pipewatch:
|
test_pipewatch:
|
||||||
nilmtools/pipewatch.py -t 3 "seq 10 20" "seq 20 30"
|
nilmtools/pipewatch.py -t 3 "seq 10 20" "seq 20 30"
|
||||||
@@ -27,7 +27,7 @@ test_cleanup:
|
|||||||
nilmtools/cleanup.py extras/cleanup.cfg
|
nilmtools/cleanup.py extras/cleanup.cfg
|
||||||
|
|
||||||
test_insert:
|
test_insert:
|
||||||
nilmtools/insert.py --file --dry-run /test/foo </dev/null
|
nilmtools/insert.py --skip --file --dry-run /foo/bar ~/data/20130311T2100.prep1.gz ~/data/20130311T2100.prep1.gz ~/data/20130311T2200.prep1.gz
|
||||||
|
|
||||||
test_copy:
|
test_copy:
|
||||||
nilmtools/copy_wildcard.py -U "http://nilmdb.com/bucket/" -D /lees*
|
nilmtools/copy_wildcard.py -U "http://nilmdb.com/bucket/" -D /lees*
|
||||||
|
@@ -53,7 +53,8 @@ def parse_args(argv = None):
|
|||||||
is stepped forward to match 'clock'.
|
is stepped forward to match 'clock'.
|
||||||
|
|
||||||
- If 'data' is running ahead, there is overlap in the data, and an
|
- If 'data' is running ahead, there is overlap in the data, and an
|
||||||
error is raised.
|
error is raised. If '--ignore' is specified, the current file
|
||||||
|
is skipped instead of raising an error.
|
||||||
"""))
|
"""))
|
||||||
parser.add_argument("-u", "--url", action="store",
|
parser.add_argument("-u", "--url", action="store",
|
||||||
default="http://localhost/nilmdb/",
|
default="http://localhost/nilmdb/",
|
||||||
@@ -61,6 +62,8 @@ def parse_args(argv = None):
|
|||||||
group = parser.add_argument_group("Misc options")
|
group = parser.add_argument_group("Misc options")
|
||||||
group.add_argument("-D", "--dry-run", action="store_true",
|
group.add_argument("-D", "--dry-run", action="store_true",
|
||||||
help="Parse files, but don't insert any data")
|
help="Parse files, but don't insert any data")
|
||||||
|
group.add_argument("-s", "--skip", action="store_true",
|
||||||
|
help="Skip files if the data would overlap")
|
||||||
group.add_argument("-m", "--max-gap", action="store", default=10.0,
|
group.add_argument("-m", "--max-gap", action="store", default=10.0,
|
||||||
metavar="SEC", type=float,
|
metavar="SEC", type=float,
|
||||||
help="Max discrepency between clock and data "
|
help="Max discrepency between clock and data "
|
||||||
@@ -235,6 +238,10 @@ def main(argv = None):
|
|||||||
"is %s but clock time is only %s",
|
"is %s but clock time is only %s",
|
||||||
timestamp_to_human(data_ts),
|
timestamp_to_human(data_ts),
|
||||||
timestamp_to_human(clock_ts))
|
timestamp_to_human(clock_ts))
|
||||||
|
if args.skip:
|
||||||
|
printf("%s\n", err)
|
||||||
|
printf("Skipping the remainder of this file\n")
|
||||||
|
break
|
||||||
raise ParseError(filename, err)
|
raise ParseError(filename, err)
|
||||||
|
|
||||||
if (data_ts + max_gap) < clock_ts:
|
if (data_ts + max_gap) < clock_ts:
|
||||||
|
Reference in New Issue
Block a user