Compare commits
5 Commits
nilmdb-1.9
...
nilmdb-1.9
Author | SHA1 | Date | |
---|---|---|---|
ccf1f695af | |||
06f7390c9e | |||
6de77a08f1 | |||
8db9771c20 | |||
04f815a24b |
6
Makefile
6
Makefile
@@ -1,5 +1,5 @@
|
|||||||
# By default, run the tests.
|
# By default, run the tests.
|
||||||
all: fscktest
|
all: test
|
||||||
|
|
||||||
version:
|
version:
|
||||||
python setup.py version
|
python setup.py version
|
||||||
@@ -23,10 +23,6 @@ docs:
|
|||||||
lint:
|
lint:
|
||||||
pylint --rcfile=.pylintrc nilmdb
|
pylint --rcfile=.pylintrc nilmdb
|
||||||
|
|
||||||
fscktest:
|
|
||||||
python -c "import nilmdb.fsck; nilmdb.fsck.Fsck('/home/jim/wsgi/db').check()"
|
|
||||||
# python -c "import nilmdb.fsck; nilmdb.fsck.Fsck('/home/jim/mnt/bucket/mnt/sharon/data/db', True).check()"
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
ifeq ($(INSIDE_EMACS), t)
|
ifeq ($(INSIDE_EMACS), t)
|
||||||
# Use the slightly more flexible script
|
# Use the slightly more flexible script
|
||||||
|
@@ -19,9 +19,8 @@ except ImportError: # pragma: no cover
|
|||||||
|
|
||||||
# Valid subcommands. Defined in separate files just to break
|
# Valid subcommands. Defined in separate files just to break
|
||||||
# things up -- they're still called with Cmdline as self.
|
# things up -- they're still called with Cmdline as self.
|
||||||
subcommands = [ "help", "info", "create", "list", "metadata",
|
subcommands = [ "help", "info", "create", "rename", "list", "intervals",
|
||||||
"insert", "extract", "remove", "destroy",
|
"metadata", "insert", "extract", "remove", "destroy" ]
|
||||||
"intervals", "rename" ]
|
|
||||||
|
|
||||||
# Import the subcommand modules
|
# Import the subcommand modules
|
||||||
subcmd_mods = {}
|
subcmd_mods = {}
|
||||||
|
@@ -74,8 +74,8 @@ class Root(NilmApp):
|
|||||||
dbsize = nilmdb.utils.du(path)
|
dbsize = nilmdb.utils.du(path)
|
||||||
return { "path": path,
|
return { "path": path,
|
||||||
"size": dbsize,
|
"size": dbsize,
|
||||||
"other": usage.used - dbsize,
|
"other": max(usage.used - dbsize, 0),
|
||||||
"reserved": usage.total - usage.used - usage.free,
|
"reserved": max(usage.total - usage.used - usage.free, 0),
|
||||||
"free": usage.free }
|
"free": usage.free }
|
||||||
|
|
||||||
class Stream(NilmApp):
|
class Stream(NilmApp):
|
||||||
|
@@ -21,7 +21,8 @@ def du(path):
|
|||||||
errors that might occur if we encounter broken symlinks or
|
errors that might occur if we encounter broken symlinks or
|
||||||
files in the process of being removed."""
|
files in the process of being removed."""
|
||||||
try:
|
try:
|
||||||
size = os.path.getsize(path)
|
st = os.stat(path)
|
||||||
|
size = st.st_blocks * 512
|
||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
for thisfile in os.listdir(path):
|
for thisfile in os.listdir(path):
|
||||||
filepath = os.path.join(path, thisfile)
|
filepath = os.path.join(path, thisfile)
|
||||||
|
Reference in New Issue
Block a user