# See COPYING file for copyrights details.
from __future__ import absolute_import
from itertools import repeat, islice, chain
from connectors.SchemeEditor import SchemeEditor
Schemes = ["WAMP", "WAMPS"]
model = [('host', _("Host:")),
class WAMP_dialog(SchemeEditor):
def __init__(self, *args, **kwargs):
self.EnableIDSelector = True
SchemeEditor.__init__(self, *args, **kwargs)
# pylint: disable=unused-variable
hostportpath, realm, ID = list(islice(chain(loc.split("#"), repeat("")), 3))
hostport, path = list(islice(chain(hostportpath.split("/"), repeat("")), 2))
host, port = list(islice(chain(hostport.split(":"), repeat("")), 2))
fields = self.GetFields()
# TODO : input validation test
(":{port}" if fields['port'] else '') +\
("/{path}" if fields['path'] else '') +\
return template.format(**fields)