def backend_values(self): init_qnetobject() serialized_ha_conf = { 'DATASTRUCTURE_VERSION': 3, "ha_type": "PRIMARY", "interface_id": "eth0", #"interface_id": "268435455", "interface_name": "eth0", "primary_hostname": "primary", } QHAObject.getInstance().cfg = HAConf.deserialize(serialized_ha_conf) return { #('ha', "getState"): ['NOT_REGISTERED', 0, ''] ('ha', "getState"): ['PRIMARY', 0, ''] }
from PyQt4.QtGui import QApplication from sys import argv, exit, stderr from ufwi_conf.client.services.dhcp import DhcpFrontend from ufwi_conf.common.dhcpcfg import DHCPCfg from mockup import MainWindow, init_qnetobject if __name__ != '__main__': stderr.write("%s is meant to be ran directly\n" % __file__) exit(2) app = QApplication(argv) client = None dhcpcfg = DHCPCfg() init_qnetobject() backend_values = { ("dhcp", "getDhcpConfig"): dhcpcfg.serialize() } parent = MainWindow(backend_values) frontend = DhcpFrontend(client, parent=parent) frontend.show() frontend.loaded() app.exec_()