|
|
@@ -53,7 +53,8 @@ def parse_args(argv = None): |
|
|
|
is stepped forward to match 'clock'. |
|
|
|
|
|
|
|
- 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", |
|
|
|
default="http://localhost/nilmdb/", |
|
|
@@ -61,6 +62,8 @@ def parse_args(argv = None): |
|
|
|
group = parser.add_argument_group("Misc options") |
|
|
|
group.add_argument("-D", "--dry-run", action="store_true", |
|
|
|
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, |
|
|
|
metavar="SEC", type=float, |
|
|
|
help="Max discrepency between clock and data " |
|
|
@@ -235,6 +238,10 @@ def main(argv = None): |
|
|
|
"is %s but clock time is only %s", |
|
|
|
timestamp_to_human(data_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) |
|
|
|
|
|
|
|
if (data_ts + max_gap) < clock_ts: |
|
|
|