diff options
author | Jhon Honce <jhonce@redhat.com> | 2018-06-27 21:37:42 -0700 |
---|---|---|
committer | Jhon Honce <jhonce@redhat.com> | 2018-07-13 11:29:28 -0700 |
commit | 44b523c946c88e540b50d7ba59f441b5f8e0bad0 (patch) | |
tree | 744c09508b139c1aca3d7fc995fad7ff354e3667 /contrib/python/cmd/utils.py | |
parent | 14a6d51a8432fc0c3324fec02e8729d3032f2af2 (diff) | |
download | podman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.tar.gz podman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.tar.bz2 podman-44b523c946c88e540b50d7ba59f441b5f8e0bad0.zip |
remote python client for podman
* Use podman library for access
* Verbose error checking
* Planned windows and macosx ports
Signed-off-by: Jhon Honce <jhonce@redhat.com>
Diffstat (limited to 'contrib/python/cmd/utils.py')
-rw-r--r-- | contrib/python/cmd/utils.py | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/contrib/python/cmd/utils.py b/contrib/python/cmd/utils.py deleted file mode 100644 index d4a14164d..000000000 --- a/contrib/python/cmd/utils.py +++ /dev/null @@ -1,32 +0,0 @@ -import sys -import math -import datetime - -def write_out(output, lf="\n"): - _output(sys.stdout, output, lf) - - -def write_err(output, lf="\n"): - _output(sys.stderr, output, lf) - - -def _output(fd, output, lf): - fd.flush() - fd.write(output + str(lf)) - - -def convert_size(size): - if size > 0: - size_name = ("B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB") - i = int(math.floor(math.log(size, 1000))) - p = math.pow(1000, i) - s = round(size/p, 2) # pylint: disable=round-builtin,old-division - if s > 0: - return '%s %s' % (s, size_name[i]) - return '0B' - -def stringTimeToHuman(t): - #datetime.date(datetime.strptime("05/Feb/2016", '%d/%b/%Y')) - #2018-04-30 13:55:45.019400581 +0000 UTC - #d = datetime.date(datetime.strptime(t, "%Y-%m-%d")) - return "sometime ago" |