Compare commits
6 Commits
nilmdb-1.9
...
nilmdb-1.9
Author | SHA1 | Date | |
---|---|---|---|
8bb8f068de | |||
416902097d | |||
f5276e9fc8 | |||
c47f28f93a | |||
63b5f99b90 | |||
7d7b89b52f |
@@ -45,6 +45,8 @@ def setup(self, sub):
|
|||||||
help="Show raw timestamps when printing times")
|
help="Show raw timestamps when printing times")
|
||||||
group.add_argument("-l", "--layout", action="store_true",
|
group.add_argument("-l", "--layout", action="store_true",
|
||||||
help="Show layout type next to path name")
|
help="Show layout type next to path name")
|
||||||
|
group.add_argument("-n", "--no-decim", action="store_true",
|
||||||
|
help="Skip paths containing \"~decim-\"")
|
||||||
|
|
||||||
return cmd
|
return cmd
|
||||||
|
|
||||||
@@ -71,6 +73,8 @@ def cmd_list(self):
|
|||||||
(path, layout, int_min, int_max, rows, time) = stream[:6]
|
(path, layout, int_min, int_max, rows, time) = stream[:6]
|
||||||
if not fnmatch.fnmatch(path, argpath):
|
if not fnmatch.fnmatch(path, argpath):
|
||||||
continue
|
continue
|
||||||
|
if self.args.no_decim and "~decim-" in path:
|
||||||
|
continue
|
||||||
|
|
||||||
if self.args.layout:
|
if self.args.layout:
|
||||||
printf("%s %s\n", path, layout)
|
printf("%s %s\n", path, layout)
|
||||||
|
@@ -59,6 +59,8 @@ def retry_if_raised(exc, message = None, max_retries = 100):
|
|||||||
|
|
||||||
class Progress(object):
|
class Progress(object):
|
||||||
def __init__(self, maxval):
|
def __init__(self, maxval):
|
||||||
|
if maxval == 0:
|
||||||
|
maxval = 1
|
||||||
self.bar = progressbar.ProgressBar(
|
self.bar = progressbar.ProgressBar(
|
||||||
maxval = maxval,
|
maxval = maxval,
|
||||||
widgets = [ progressbar.Percentage(), ' ',
|
widgets = [ progressbar.Percentage(), ' ',
|
||||||
@@ -381,7 +383,7 @@ class Fsck(object):
|
|||||||
err("*** Deleting the entire interval from SQL.\n")
|
err("*** Deleting the entire interval from SQL.\n")
|
||||||
err("This may leave stale data on disk. To fix that, copy all\n")
|
err("This may leave stale data on disk. To fix that, copy all\n")
|
||||||
err("data from this stream to a new stream, then remove all data\n")
|
err("data from this stream to a new stream, then remove all data\n")
|
||||||
err("from and destroy %s.\n")
|
err("from and destroy %s.\n", path)
|
||||||
with self.sql:
|
with self.sql:
|
||||||
cur = self.sql.cursor()
|
cur = self.sql.cursor()
|
||||||
cur.execute("DELETE FROM ranges WHERE "
|
cur.execute("DELETE FROM ranges WHERE "
|
||||||
|
@@ -194,6 +194,9 @@ class BulkData(object):
|
|||||||
if oldospath == newospath:
|
if oldospath == newospath:
|
||||||
raise ValueError("old and new paths are the same")
|
raise ValueError("old and new paths are the same")
|
||||||
|
|
||||||
|
# Remove Table object at old path from cache
|
||||||
|
self.getnode.cache_remove(self, oldunicodepath)
|
||||||
|
|
||||||
# Move the table to a temporary location
|
# Move the table to a temporary location
|
||||||
tmpdir = tempfile.mkdtemp(prefix = "rename-", dir = self.root)
|
tmpdir = tempfile.mkdtemp(prefix = "rename-", dir = self.root)
|
||||||
tmppath = os.path.join(tmpdir, "table")
|
tmppath = os.path.join(tmpdir, "table")
|
||||||
|
@@ -117,7 +117,10 @@ def serializer_proxy(obj_or_type):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.__call_queue.put((None, None, None, None))
|
try:
|
||||||
self.__thread.join()
|
self.__call_queue.put((None, None, None, None))
|
||||||
|
self.__thread.join()
|
||||||
|
except TypeError: # pragma: no cover
|
||||||
|
pass
|
||||||
|
|
||||||
return SerializerObjectProxy(obj_or_type)
|
return SerializerObjectProxy(obj_or_type)
|
||||||
|
@@ -290,6 +290,7 @@ class TestCmdline(object):
|
|||||||
self.ok("create /newton/zzz/rawnotch uint16_9")
|
self.ok("create /newton/zzz/rawnotch uint16_9")
|
||||||
self.ok("create /newton/prep float32_8")
|
self.ok("create /newton/prep float32_8")
|
||||||
self.ok("create /newton/raw uint16_6")
|
self.ok("create /newton/raw uint16_6")
|
||||||
|
self.ok("create /newton/raw~decim-1234 uint16_6")
|
||||||
|
|
||||||
# Create a stream that already exists
|
# Create a stream that already exists
|
||||||
self.fail("create /newton/raw uint16_6")
|
self.fail("create /newton/raw uint16_6")
|
||||||
@@ -305,13 +306,23 @@ class TestCmdline(object):
|
|||||||
self.fail("create /newton/zzz float32_8")
|
self.fail("create /newton/zzz float32_8")
|
||||||
self.contain("subdirs of this path already exist")
|
self.contain("subdirs of this path already exist")
|
||||||
|
|
||||||
# Verify we got those 3 streams and they're returned in
|
# Verify we got those 4 streams and they're returned in
|
||||||
# alphabetical order.
|
# alphabetical order.
|
||||||
self.ok("list -l")
|
self.ok("list -l")
|
||||||
self.match("/newton/prep float32_8\n"
|
self.match("/newton/prep float32_8\n"
|
||||||
"/newton/raw uint16_6\n"
|
"/newton/raw uint16_6\n"
|
||||||
|
"/newton/raw~decim-1234 uint16_6\n"
|
||||||
"/newton/zzz/rawnotch uint16_9\n")
|
"/newton/zzz/rawnotch uint16_9\n")
|
||||||
|
|
||||||
|
# No decimated streams if -n specified
|
||||||
|
self.ok("list -n -l")
|
||||||
|
self.match("/newton/prep float32_8\n"
|
||||||
|
"/newton/raw uint16_6\n"
|
||||||
|
"/newton/zzz/rawnotch uint16_9\n")
|
||||||
|
|
||||||
|
# Delete that decimated stream
|
||||||
|
self.ok("destroy /newton/raw~decim-1234")
|
||||||
|
|
||||||
# Match just one type or one path. Also check
|
# Match just one type or one path. Also check
|
||||||
# that --path is optional
|
# that --path is optional
|
||||||
self.ok("list --layout /newton/raw")
|
self.ok("list --layout /newton/raw")
|
||||||
|
Reference in New Issue
Block a user