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.
|
||||
all: fscktest
|
||||
all: test
|
||||
|
||||
version:
|
||||
python setup.py version
|
||||
@@ -23,10 +23,6 @@ docs:
|
||||
lint:
|
||||
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:
|
||||
ifeq ($(INSIDE_EMACS), t)
|
||||
# Use the slightly more flexible script
|
||||
|
@@ -19,9 +19,8 @@ except ImportError: # pragma: no cover
|
||||
|
||||
# Valid subcommands. Defined in separate files just to break
|
||||
# things up -- they're still called with Cmdline as self.
|
||||
subcommands = [ "help", "info", "create", "list", "metadata",
|
||||
"insert", "extract", "remove", "destroy",
|
||||
"intervals", "rename" ]
|
||||
subcommands = [ "help", "info", "create", "rename", "list", "intervals",
|
||||
"metadata", "insert", "extract", "remove", "destroy" ]
|
||||
|
||||
# Import the subcommand modules
|
||||
subcmd_mods = {}
|
||||
|
@@ -74,8 +74,8 @@ class Root(NilmApp):
|
||||
dbsize = nilmdb.utils.du(path)
|
||||
return { "path": path,
|
||||
"size": dbsize,
|
||||
"other": usage.used - dbsize,
|
||||
"reserved": usage.total - usage.used - usage.free,
|
||||
"other": max(usage.used - dbsize, 0),
|
||||
"reserved": max(usage.total - usage.used - usage.free, 0),
|
||||
"free": usage.free }
|
||||
|
||||
class Stream(NilmApp):
|
||||
|
@@ -21,7 +21,8 @@ def du(path):
|
||||
errors that might occur if we encounter broken symlinks or
|
||||
files in the process of being removed."""
|
||||
try:
|
||||
size = os.path.getsize(path)
|
||||
st = os.stat(path)
|
||||
size = st.st_blocks * 512
|
||||
if os.path.isdir(path):
|
||||
for thisfile in os.listdir(path):
|
||||
filepath = os.path.join(path, thisfile)
|
||||
|
Reference in New Issue
Block a user