Compare commits
4 Commits
nilmdb-2.0
...
nilmdb-2.0
Author | SHA1 | Date | |
---|---|---|---|
0222dfebf0 | |||
70914690c1 | |||
10400f2b07 | |||
56153ff7ad |
19
README.md
19
README.md
@@ -6,14 +6,13 @@ NilmDB requires Python 3.7 or newer.
|
||||
## Prerequisites:
|
||||
|
||||
# Runtime and build environments
|
||||
sudo apt install python3.7 python3.7-dev python3.7-venv python3-pip
|
||||
sudo apt install python3 python3-dev python3-venv python3-pip
|
||||
|
||||
# Optional: create a new Python virtual environment to isolate
|
||||
# dependencies. To leave the virtual environment, run "deactivate"
|
||||
python -m venv venv
|
||||
source venv/bin/activate
|
||||
# Create a new Python virtual environment to isolate deps.
|
||||
python3 -m venv ../venv
|
||||
source ../venv/bin/activate # run "deactivate" to leave
|
||||
|
||||
# Install all Python dependencies from PyPI.
|
||||
# Install all Python dependencies
|
||||
pip3 install -r requirements.txt
|
||||
|
||||
## Test:
|
||||
@@ -22,6 +21,14 @@ NilmDB requires Python 3.7 or newer.
|
||||
|
||||
## Install:
|
||||
|
||||
Install it into the virtual environment
|
||||
|
||||
python3 setup.py install
|
||||
|
||||
If you want to instead install it system-wide, you will also need to
|
||||
install the requirements system-wide:
|
||||
|
||||
sudo pip3 install -r requirements.txt
|
||||
sudo python3 setup.py install
|
||||
|
||||
## Usage:
|
||||
|
@@ -168,7 +168,7 @@ static int Rocket_init(Rocket *self, PyObject *args, PyObject *kwds)
|
||||
if (!layout)
|
||||
return -1;
|
||||
if (path) {
|
||||
if (strlen(path) != pathlen) {
|
||||
if (strlen(path) != (size_t)pathlen) {
|
||||
PyErr_SetString(PyExc_ValueError, "path must not "
|
||||
"contain NUL characters");
|
||||
return -1;
|
||||
@@ -477,7 +477,7 @@ static PyObject *Rocket_append_binary(Rocket *self, PyObject *args)
|
||||
}
|
||||
|
||||
/* Write binary data */
|
||||
if (fwrite(data, self->binary_size, rows, self->file) != rows) {
|
||||
if (fwrite(data, self->binary_size, rows, self->file) != (size_t)rows) {
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ static PyObject *Rocket_extract_binary(Rocket *self, PyObject *args)
|
||||
|
||||
/* Data in the file is already in the desired little-endian
|
||||
binary format, so just read it directly. */
|
||||
if (fread(str, self->binary_size, count, self->file) != count) {
|
||||
if (fread(str, self->binary_size, count, self->file) != (size_t)count) {
|
||||
free(str);
|
||||
PyErr_SetFromErrno(PyExc_OSError);
|
||||
return NULL;
|
||||
|
4
setup.py
4
setup.py
@@ -4,7 +4,7 @@
|
||||
# git tag -a nilmdb-1.1 -m "Version 1.1"
|
||||
# git push --tags
|
||||
# Then just package it up:
|
||||
# python setup.py sdist
|
||||
# python3 setup.py sdist
|
||||
|
||||
import sys
|
||||
import os
|
||||
@@ -36,7 +36,7 @@ install_requires = open('requirements.txt').readlines()
|
||||
setup(name='nilmdb',
|
||||
version = versioneer.get_version(),
|
||||
cmdclass = versioneer.get_cmdclass(),
|
||||
url = 'https://git.jim.sh/jim/lees/nilmdb.git',
|
||||
url = 'https://git.jim.sh/nilm/nilmdb.git',
|
||||
author = 'Jim Paris',
|
||||
description = "NILM Database",
|
||||
long_description = "NILM Database",
|
||||
|
Reference in New Issue
Block a user