[TASK] Add editorconfig & format code (#94)

This commit is contained in:
Xaver Maierhofer 2017-11-06 00:59:42 +01:00 committed by Julian K
parent 918b279b23
commit 93321ab3ad
8 changed files with 184 additions and 130 deletions

17
.editorconfig Normal file
View File

@ -0,0 +1,17 @@
; http://editorconfig.org/
root = true
[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
[*.go]
indent_style = tab
indent_size = 4
[*.{json,yml}]
indent_style = space
indent_size = 2

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python3
import json
import argparse
import json
import sys
@ -18,6 +18,7 @@ def main(states, nodeid):
with open(states, 'w') as handle:
json.dump(data, handle)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
@ -29,4 +30,3 @@ if __name__ == '__main__':
args = parser.parse_args()
main(args.states, args.nodeid)

View File

@ -8,7 +8,6 @@ import (
var multiCastGroup = net.ParseIP("ff02:0:0:0:0:0:2:1001")
const (
// default udp port used by announced
port = 1001

View File

@ -1,30 +1,42 @@
{
"nodeinfo":{
"node_id":"node1.json",
"network":{
"mac": "a",
"mesh":{
"bat0":{
"interfaces":{
"wireless":["a"],
"other":["a2"]
}
}
}
}
},
"neighbours":{
"batadv":{
"a":{
"neighbours":{
"b":{"tq":150,"lastseen":0.42},
"c":{"tq":250,"lastseen":0.42}
}
}
},
"lldp":{
"a2": {"c2": {}}
}
}
"nodeinfo": {
"node_id": "node1.json",
"network": {
"mac": "a",
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"a"
],
"other": [
"a2"
]
}
}
}
}
},
"neighbours": {
"batadv": {
"a": {
"neighbours": {
"b": {
"tq": 150,
"lastseen": 0.42
},
"c": {
"tq": 250,
"lastseen": 0.42
}
}
}
},
"lldp": {
"a2": {
"c2": {}
}
}
}
}

View File

@ -1,24 +1,29 @@
{
"nodeinfo":{
"node_id":"node2.json",
"network":{
"mesh":{
"bat0":{
"interfaces":{
"wireless":["b"]
}
}
}
}
},
"neighbours":{
"batadv":{
"b":{
"neighbours":{
"a":{"tq":250,"lastseen":0.42}
}
}
}
}
"nodeinfo": {
"node_id": "node2.json",
"network": {
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"b"
]
}
}
}
}
},
"neighbours": {
"batadv": {
"b": {
"neighbours": {
"a": {
"tq": 250,
"lastseen": 0.42
}
}
}
}
}
}

View File

@ -1,28 +1,37 @@
{
"nodeinfo":{
"node_id":"node3.json",
"network":{
"mesh":{
"bat0":{
"interfaces":{
"wireless":["c"],
"other":["c2"]
}
}
}
}
},
"neighbours":{
"batadv":{
"c":{
"neighbours":{
"a":{"tq":200,"lastseen":0.42}
}
}
},
"lldp":{
"c2": {"a2": {}}
}
}
"nodeinfo": {
"node_id": "node3.json",
"network": {
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"c"
],
"other": [
"c2"
]
}
}
}
}
},
"neighbours": {
"batadv": {
"c": {
"neighbours": {
"a": {
"tq": 200,
"lastseen": 0.42
}
}
}
},
"lldp": {
"c2": {
"a2": {}
}
}
}
}

View File

@ -1,25 +1,33 @@
{
"nodeinfo":{
"node_id":"node4.json",
"network":{
"mesh":{
"bat0":{
"interfaces":{
"wireless":["unneed","unneed2"],
"tunnel":["d"]
}
}
}
}
},
"neighbours":{
"batadv":{
"d":{
"neighbours":{
"a":{"tq":200,"lastseen":0.42}
}
}
}
}
"nodeinfo": {
"node_id": "node4.json",
"network": {
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"unneed",
"unneed2"
],
"tunnel": [
"d"
]
}
}
}
}
},
"neighbours": {
"batadv": {
"d": {
"neighbours": {
"a": {
"tq": 200,
"lastseen": 0.42
}
}
}
}
}
}

View File

@ -1,34 +1,38 @@
{
"nodes": {
"f4f26dd7a30a": {
"firstseen": "2017-03-10T12:12:01",
"nodeinfo": {
"node_id":"f4f26dd7a30a",
"network":{
"mesh":{
"bat0":{
"interfaces":{
"wireless":["a"]
}
}
}
}
}
},
"f4f26dd7a30b": {
"firstseen": "2016-03-10T12:12:01",
"nodeinfo": {
"node_id":"f4f26dd7a30b",
"network":{
"mesh":{
"bat0":{
"interfaces":{
"wireless":["a"]
}
}
}
}
}
}
}
"nodes": {
"f4f26dd7a30a": {
"firstseen": "2017-03-10T12:12:01",
"nodeinfo": {
"node_id": "f4f26dd7a30a",
"network": {
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"a"
]
}
}
}
}
}
},
"f4f26dd7a30b": {
"firstseen": "2016-03-10T12:12:01",
"nodeinfo": {
"node_id": "f4f26dd7a30b",
"network": {
"mesh": {
"bat0": {
"interfaces": {
"wireless": [
"a"
]
}
}
}
}
}
}
}
}