Commit bfffdf9d authored by Stavros Sachtouris's avatar Stavros Sachtouris Committed by Giorgos Korfiatis
Browse files

Implement Agkyra GUI and helper

parent f6991720
from ws4py.websocket import WebSocket
class WebSocketProtocol(WebSocket):
"""Helper-side WebSocket protocol for communication with GUI:
-- INTERRNAL HANDSAKE --
GUI: {"token": <token>}
HELPER: {"ACCEPTED": 202}" or "{"ERROR": 401, "MESSAGE": <message>}
-- GET SETTINGS --
GUI: {"method": "get", "path": "settings"}
HELPER:
{
"token": <user token>,
"url": <auth url>,
"container": <container>,
"directory": <local directory>,
"exclude": <file path>
} or {"ERROR": <error code>, "MESSAGE": <message>}"
-- PUT SETTINGS --
GUI: {
"method": "put", "path": "settings",
"token": <user token>,
"url": <auth url>,
"container": <container>,
"directory": <local directory>,
"exclude": <file path>
}
HELPER: {"CREATED": 201} or {"ERROR": <error code>, "MESSAGE": <message>}
-- GET STATUS --
GUI: {"method": "get", "path": "status"}
HELPER: ""progres": <int>, "paused": <boolean>} or
{"ERROR": <error code>, "MESSAGE": <message>}
"""
def __init__(self, *args, **kwargs):
super(WebSocketProtocol, self).__init__(*args, **kwargs)
print 'lala'
Markdown is supported
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