Browse Source

Tweak options, dependencies, documentation

tags/nilmdb-1.9.1^0
Jim Paris 7 years ago
parent
commit
8dd8741100
4 changed files with 13 additions and 5 deletions
  1. +3
    -1
      README.txt
  2. +5
    -1
      nilmdb/fsck/fsck.py
  3. +4
    -3
      nilmdb/scripts/nilmdb_fsck.py
  4. +1
    -0
      setup.py

+ 3
- 1
README.txt View File

@@ -8,7 +8,8 @@ Prerequisites:

# Base NilmDB dependencies
sudo apt-get install python-cherrypy3 python-decorator python-simplejson
sudo apt-get install python-requests python-dateutil python-tz python-psutil
sudo apt-get install python-requests python-dateutil python-tz
sudo apt-get install python-progressbar python-psutil

# Other dependencies (required by some modules)
sudo apt-get install python-numpy
@@ -26,6 +27,7 @@ Install:
Usage:

nilmdb-server --help
nilmdb-fsck --help
nilmtool --help

See docs/wsgi.md for info on setting up a WSGI application in Apache.

+ 5
- 1
nilmdb/fsck/fsck.py View File

@@ -33,7 +33,7 @@ class FixableFsckError(FsckError):
def __init__(self, msg = "", *args):
if args:
msg = sprintf(msg, *args)
FsckError.__init__(self, "%s\nThis may be fixable with \"-y\".", msg)
FsckError.__init__(self, "%s\nThis may be fixable with \"--fix\".", msg)
class RetryFsck(FsckError):
pass

@@ -440,6 +440,10 @@ class Fsck(object):
path, first_ts, last_ts, start)
last_ts = data['timestamp'][-1]

# These are probably fixable, by removing the offending
# intervals. But I'm not going to bother implementing
# that yet.

# Done
done += count
update(done)


+ 4
- 3
nilmdb/scripts/nilmdb_fsck.py View File

@@ -13,12 +13,13 @@ def main():
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument("-V", "--version", action="version",
version = nilmdb.__version__)
parser.add_argument('-y', dest="fix", action="store_true",
default=False, help = 'Fix errors')
parser.add_argument("-f", "--fix", action="store_true",
default=False, help = 'Fix errors when possible '
'(which may involve removing data)')
parser.add_argument('database', help = 'Database directory')
args = parser.parse_args()

nilmdb.fsck.Fsck(args.database).check(args.fix)
nilmdb.fsck.Fsck(args.database, args.fix).check()

if __name__ == "__main__":
main()

+ 1
- 0
setup.py View File

@@ -118,6 +118,7 @@ setup(name='nilmdb',
'pytz',
'psutil >= 0.3.0',
'requests >= 1.1.0, < 2.0.0',
'progressbar >= 2.2',
],
packages = [ 'nilmdb',
'nilmdb.utils',


Loading…
Cancel
Save