Commit 568e1e58 authored by Bram Daams's avatar Bram Daams
Browse files

fixed some flake8 messages

parent 976d8761
Pipeline #34666 passed with stage
in 34 seconds
......@@ -2,6 +2,15 @@
SmartCronHelper
## Install
``` console
$ python -m venv venv
$ . venv/bin/activate
$ python install .
```
## Test
For now, create a file `test.py`
``` python
from hc import hc, hcCred, hcRegistry
......@@ -12,3 +21,13 @@ registry = hcRegistry(cred, '/var/lib/hcregistry.json')
h = hc(cred)
h.print_status()
```
And run it within the virtual environment
## Syntax check
In the virtual environment:
``` console
$ pip install flake8
$ flake8 *py
```
......@@ -4,6 +4,7 @@ import click
import arrow
import json
class hcCred:
def __init__(self, url, api_key):
self.url = url
......@@ -21,14 +22,12 @@ class hcRegistry:
# read file
try:
with open(self.registry, 'r') as myfile:
data=myfile.read()
data = myfile.read()
# parse file
self.data = json.loads(data)
except Exception as e:
print ("could not load registry")
except Exception:
print("could not load registry")
def register(self, id):
pass
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment