Compare commits
4 Commits
nilmrun-2.
...
master
Author | SHA1 | Date | |
---|---|---|---|
eae6dd623f | |||
09a9ed9734 | |||
079a2b5192 | |||
e7f52a4013 |
2
.gitattributes
vendored
2
.gitattributes
vendored
|
@ -1 +1 @@
|
|||
src/_version.py export-subst
|
||||
nilmrun/_version.py export-subst
|
||||
|
|
|
@ -41,9 +41,9 @@ def get_config():
|
|||
cfg = VersioneerConfig()
|
||||
cfg.VCS = "git"
|
||||
cfg.style = "pep440"
|
||||
cfg.tag_prefix = "nilmdb-"
|
||||
cfg.parentdir_prefix = "nilmdb-"
|
||||
cfg.versionfile_source = "nilmdb/_version.py"
|
||||
cfg.tag_prefix = "nilmrun-"
|
||||
cfg.parentdir_prefix = "nilmrun-"
|
||||
cfg.versionfile_source = "nilmrun/_version.py"
|
||||
cfg.verbose = False
|
||||
return cfg
|
||||
|
||||
|
@ -86,20 +86,20 @@ def run_command(commands, args, cwd=None, verbose=False, hide_stderr=False,
|
|||
if e.errno == errno.ENOENT:
|
||||
continue
|
||||
if verbose:
|
||||
print(("unable to run %s" % dispcmd))
|
||||
print("unable to run %s" % dispcmd)
|
||||
print(e)
|
||||
return None, None
|
||||
else:
|
||||
if verbose:
|
||||
print(("unable to find command, tried %s" % (commands,)))
|
||||
print("unable to find command, tried %s" % (commands,))
|
||||
return None, None
|
||||
stdout = p.communicate()[0].strip()
|
||||
if sys.version_info[0] >= 3:
|
||||
stdout = stdout.decode()
|
||||
if p.returncode != 0:
|
||||
if verbose:
|
||||
print(("unable to run %s (error)" % dispcmd))
|
||||
print(("stdout was %s" % stdout))
|
||||
print("unable to run %s (error)" % dispcmd)
|
||||
print("stdout was %s" % stdout)
|
||||
return None, p.returncode
|
||||
return stdout, p.returncode
|
||||
|
||||
|
@ -124,8 +124,8 @@ def versions_from_parentdir(parentdir_prefix, root, verbose):
|
|||
root = os.path.dirname(root) # up a level
|
||||
|
||||
if verbose:
|
||||
print(("Tried directories %s but none started with prefix %s" %
|
||||
(str(rootdirs), parentdir_prefix)))
|
||||
print("Tried directories %s but none started with prefix %s" %
|
||||
(str(rootdirs), parentdir_prefix))
|
||||
raise NotThisMethod("rootdir doesn't start with parentdir_prefix")
|
||||
|
||||
|
||||
|
@ -192,15 +192,15 @@ def git_versions_from_keywords(keywords, tag_prefix, verbose):
|
|||
# "stabilization", as well as "HEAD" and "master".
|
||||
tags = set([r for r in refs if re.search(r'\d', r)])
|
||||
if verbose:
|
||||
print(("discarding '%s', no digits" % ",".join(refs - tags)))
|
||||
print("discarding '%s', no digits" % ",".join(refs - tags))
|
||||
if verbose:
|
||||
print(("likely tags: %s" % ",".join(sorted(tags))))
|
||||
print("likely tags: %s" % ",".join(sorted(tags)))
|
||||
for ref in sorted(tags):
|
||||
# sorting will prefer e.g. "2.0" over "2.0rc1"
|
||||
if ref.startswith(tag_prefix):
|
||||
r = ref[len(tag_prefix):]
|
||||
if verbose:
|
||||
print(("picking %s" % r))
|
||||
print("picking %s" % r)
|
||||
return {"version": r,
|
||||
"full-revisionid": keywords["full"].strip(),
|
||||
"dirty": False, "error": None,
|
||||
|
@ -229,7 +229,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
|||
hide_stderr=True)
|
||||
if rc != 0:
|
||||
if verbose:
|
||||
print(("Directory %s not under git control" % root))
|
||||
print("Directory %s not under git control" % root)
|
||||
raise NotThisMethod("'git rev-parse --git-dir' returned error")
|
||||
|
||||
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
|
||||
|
@ -278,7 +278,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
|
|||
if not full_tag.startswith(tag_prefix):
|
||||
if verbose:
|
||||
fmt = "tag '%s' doesn't start with prefix '%s'"
|
||||
print((fmt % (full_tag, tag_prefix)))
|
||||
print(fmt % (full_tag, tag_prefix))
|
||||
pieces["error"] = ("tag '%s' doesn't start with prefix '%s'"
|
||||
% (full_tag, tag_prefix))
|
||||
return pieces
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import threading
|
||||
import subprocess
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
nilmdb>=2.0.2
|
||||
psutil>=2.0.0
|
||||
nilmdb>=2.0.3
|
||||
psutil==5.7.2
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from nilmdb.client.httpclient import HTTPClient, ClientError, ServerError
|
||||
from nilmdb.utils.printf import *
|
||||
|
@ -13,7 +13,8 @@ def main():
|
|||
def_url = os.environ.get("NILMRUN_URL", "http://localhost/nilmrun/")
|
||||
parser = argparse.ArgumentParser(
|
||||
description = 'Kill/remove a process from the NilmRun server',
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter,
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("-v", "--version", action="version",
|
||||
version=nilmrun.__version__)
|
||||
group = parser.add_argument_group("Standard options")
|
||||
group.add_argument('-u', '--url',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import nilmrun.server
|
||||
import argparse
|
||||
|
@ -10,7 +10,8 @@ def main():
|
|||
|
||||
parser = argparse.ArgumentParser(
|
||||
description = 'Run the NilmRun server',
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter,
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("-v", "--version", action="version",
|
||||
version=nilmrun.__version__)
|
||||
|
||||
group = parser.add_argument_group("Standard options")
|
||||
|
@ -34,7 +35,6 @@ def main():
|
|||
embedded = False
|
||||
server = nilmrun.server.Server(host = args.address,
|
||||
port = args.port,
|
||||
embedded = embedded,
|
||||
force_traceback = args.traceback)
|
||||
|
||||
# Print info
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from nilmdb.client.httpclient import HTTPClient, ClientError, ServerError
|
||||
from nilmdb.utils.printf import *
|
||||
from nilmdb.utils import datetime_tz
|
||||
import datetime_tz
|
||||
import nilmrun
|
||||
|
||||
import argparse
|
||||
|
@ -13,7 +13,8 @@ def main():
|
|||
def_url = os.environ.get("NILMRUN_URL", "http://localhost/nilmrun/")
|
||||
parser = argparse.ArgumentParser(
|
||||
description = 'List NilmRun processes',
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter,
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("-v", "--version", action="version",
|
||||
version=nilmrun.__version__)
|
||||
group = parser.add_argument_group("Standard options")
|
||||
group.add_argument('-u', '--url',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from nilmdb.client.httpclient import HTTPClient, ClientError, ServerError
|
||||
from nilmdb.utils.printf import *
|
||||
|
@ -14,7 +14,8 @@ def main():
|
|||
def_url = os.environ.get("NILMRUN_URL", "http://localhost/nilmrun/")
|
||||
parser = argparse.ArgumentParser(
|
||||
description = 'Run a command on the NilmRun server',
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter,
|
||||
formatter_class = argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument("-v", "--version", action="version",
|
||||
version=nilmrun.__version__)
|
||||
group = parser.add_argument_group("Standard options")
|
||||
group.add_argument('-u', '--url',
|
||||
|
@ -30,7 +31,8 @@ def main():
|
|||
help="Arguments for command")
|
||||
args = parser.parse_args()
|
||||
|
||||
client = HTTPClient(baseurl = args.url, verify_ssl = not args.noverify)
|
||||
client = HTTPClient(baseurl=args.url, verify_ssl=not args.noverify,
|
||||
post_json=True)
|
||||
|
||||
# Run command
|
||||
pid = client.post("run/command", { "argv": [ args.cmd ] + args.arg })
|
||||
|
|
2
setup.py
2
setup.py
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# To release a new version, tag it:
|
||||
# git tag -a nilmrun-1.1 -m "Version 1.1"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/python
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import nose
|
||||
import os
|
||||
|
|
|
@ -276,11 +276,11 @@ https://creativecommons.org/publicdomain/zero/1.0/ .
|
|||
|
||||
"""
|
||||
|
||||
|
||||
from __future__ import print_function
|
||||
try:
|
||||
import configparser
|
||||
except ImportError:
|
||||
import configparser as configparser
|
||||
import ConfigParser as configparser
|
||||
import errno
|
||||
import json
|
||||
import os
|
||||
|
|
Loading…
Reference in New Issue
Block a user