{"action":"created","issue":{"url":"https://api.github.com/repos/dddomodossola/remi/issues/140","repository_url":"https://api.github.com/repos/dddomodossola/remi","labels_url":"https://api.github.com/repos/dddomodossola/remi/issues/140/labels{/name}","comments_url":"https://api.github.com/repos/dddomodossola/remi/issues/140/comments","events_url":"https://api.github.com/repos/dddomodossola/remi/issues/140/events","html_url":"https://github.com/dddomodossola/remi/issues/140","id":183958664,"number":140,"title":"Associated a signal with slider and reopening file in editor, causes exception","user":{"login":"MrYsLab","id":5189838,"avatar_url":"https://avatars.githubusercontent.com/u/5189838?v=3","gravatar_id":"","url":"https://api.github.com/users/MrYsLab","html_url":"https://github.com/MrYsLab","followers_url":"https://api.github.com/users/MrYsLab/followers","following_url":"https://api.github.com/users/MrYsLab/following{/other_user}","gists_url":"https://api.github.com/users/MrYsLab/gists{/gist_id}","starred_url":"https://api.github.com/users/MrYsLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrYsLab/subscriptions","organizations_url":"https://api.github.com/users/MrYsLab/orgs","repos_url":"https://api.github.com/users/MrYsLab/repos","events_url":"https://api.github.com/users/MrYsLab/events{/privacy}","received_events_url":"https://api.github.com/users/MrYsLab/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-10-19T13:16:37Z","updated_at":"2016-10-19T13:37:50Z","closed_at":null,"body":"I created a simple project that contains a top level widget with a single slider. I associate the slider with an onclick app signal connection. \r\n\r\nI am running the editor using python 3.5 on Ubuntu 16.10 and using the chrome browser.\r\n\r\nHere is the generated code:\r\n```\r\n\r\nimport remi.gui as gui\r\nfrom remi.gui import *\r\nfrom remi import start, App\r\n\r\n\r\nclass untitled(App):\r\n    def __init__(self, *args):\r\n        super(untitled, self).__init__(*args, static_file_path='./res/')\r\n    \r\n    def idle(self):\r\n        #idle function called every update cycle\r\n        pass\r\n    \r\n    def main(self):\r\n        return untitled.construct_ui(self)\r\n        \r\n    @staticmethod\r\n    def construct_ui(self):\r\n        top = Widget()\r\n        top.attributes['editor_varname'] = \"top\"\r\n        top.attributes['editor_newclass'] = \"False\"\r\n        top.attributes['class'] = \"Widget\"\r\n        top.attributes['editor_constructor'] = \"()\"\r\n        top.attributes['editor_baseclass'] = \"Widget\"\r\n        top.attributes['editor_tag_type'] = \"widget\"\r\n        top.style['top'] = \"232.34375px\"\r\n        top.style['position'] = \"absolute\"\r\n        top.style['display'] = \"block\"\r\n        top.style['height'] = \"250px\"\r\n        top.style['left'] = \"361px\"\r\n        top.style['width'] = \"250px\"\r\n        top.style['margin'] = \"0px auto\"\r\n        top.style['overflow'] = \"auto\"\r\n        slider = Slider('60',60,255,1)\r\n        slider.attributes['min'] = \"60\"\r\n        slider.attributes['editor_varname'] = \"slider\"\r\n        slider.attributes['editor_newclass'] = \"False\"\r\n        slider.attributes['autocomplete'] = \"off\"\r\n        slider.attributes['class'] = \"range\"\r\n        slider.attributes['editor_constructor'] = \"('60',60,255,1)\"\r\n        slider.attributes['editor_baseclass'] = \"Slider\"\r\n        slider.attributes['type'] = \"range\"\r\n        slider.attributes['max'] = \"255\"\r\n        slider.attributes['editor_tag_type'] = \"widget\"\r\n        slider.attributes['value'] = \"60\"\r\n        slider.attributes['step'] = \"1\"\r\n        slider.style['top'] = \"102px\"\r\n        slider.style['position'] = \"absolute\"\r\n        slider.style['display'] = \"block\"\r\n        slider.style['height'] = \"30px\"\r\n        slider.style['left'] = \"98px\"\r\n        slider.style['width'] = \"100px\"\r\n        slider.style['margin'] = \"0px auto\"\r\n        slider.style['overflow'] = \"auto\"\r\n        top.append(slider,'slider')\r\n        top.set_on_click_listener(self.onclick_top)\r\n        \r\n\r\n        self.top = top\r\n        return self.top\r\n    \r\n    def onclick_top(self,emitter):\r\n        pass\r\n\r\n\r\n\r\n#Configuration\r\nconfiguration = {'config_project_name': 'untitled', 'config_address': '0.0.0.0', 'config_start_browser': True, 'config_port': 8081, 'config_resourcepath': './res/', 'config_enable_file_cache': True, 'config_multiple_instance': True}\r\n\r\nif __name__ == \"__main__\":\r\n    # start(MyApp,address='127.0.0.1', port=8081, multiple_instance=False,enable_file_cache=True, update_interval=0.1, start_browser=True)\r\n    start(untitled, address=configuration['config_address'], port=configuration['config_port'], \r\n                        multiple_instance=configuration['config_multiple_instance'], \r\n                        enable_file_cache=configuration['config_enable_file_cache'],\r\n                        start_browser=configuration['config_start_browser'])\r\n```\r\n\r\nAfter saving the file and trying to reload it in the editor, an exception is thrown:\r\n\r\n```\r\nremi.server.ws   INFO     connection established: ('127.0.0.1', 36308)\r\nremi.server.ws   INFO     handshake complete\r\nremi.server.ws   INFO     connection established: ('127.0.0.1', 36338)\r\nremi.server.ws   INFO     handshake complete\r\nremi.server.ws   INFO     connection established: ('127.0.0.1', 36386)\r\nremi.server.ws   INFO     handshake complete\r\nremi.server.ws   ERROR    error parsing websocket\r\nTraceback (most recent call last):\r\n  File \"/usr/local/lib/python3.5/dist-packages/remi/server.py\", line 254, in on_message\r\n    callback(**param_dict)\r\n  File \"/usr/local/lib/python3.5/dist-packages/remi/gui.py\", line 1289, in confirm_dialog\r\n    return self.eventManager.propagate(self.EVENT_ONCONFIRM, ())\r\n  File \"/usr/local/lib/python3.5/dist-packages/remi/gui.py\", line 139, in propagate\r\n    return listener['callback'](self.emitter, *(params+listener['userdata']))\r\n  File \"/usr/local/lib/python3.5/dist-packages/remi/gui.py\", line 2265, in confirm_value\r\n    return self.eventManager.propagate(self.EVENT_ONCONFIRMVALUE, params)\r\n  File \"/usr/local/lib/python3.5/dist-packages/remi/gui.py\", line 139, in propagate\r\n    return listener['callback'](self.emitter, *(params+listener['userdata']))\r\n  File \"editor.py\", line 528, in on_open_dialog_confirm\r\n    widgetTree = self.project.load(filelist[0], self.projectConfiguration)\r\n  File \"editor.py\", line 115, in load\r\n    return value.construct_ui(self)\r\n  File \"/home/afy/remi2/remi-master/editor/click.py\", line 57, in construct_ui\r\n    top.set_on_click_listener(self.onclick_top)\r\nAttributeError: 'Project' object has no attribute 'onclick_top'\r\nremi.server.ws   INFO     connection established: ('127.0.0.1', 36596)\r\nremi.server.ws   INFO     handshake complete\r\nremi.server.ws   INFO     connection established: ('127.0.0.1', 36620)\r\nremi.server.ws   INFO     handshake complete\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/dddomodossola/remi/issues/comments/254814718","html_url":"https://github.com/dddomodossola/remi/issues/140#issuecomment-254814718","issue_url":"https://api.github.com/repos/dddomodossola/remi/issues/140","id":254814718,"user":{"login":"MrYsLab","id":5189838,"avatar_url":"https://avatars.githubusercontent.com/u/5189838?v=3","gravatar_id":"","url":"https://api.github.com/users/MrYsLab","html_url":"https://github.com/MrYsLab","followers_url":"https://api.github.com/users/MrYsLab/followers","following_url":"https://api.github.com/users/MrYsLab/following{/other_user}","gists_url":"https://api.github.com/users/MrYsLab/gists{/gist_id}","starred_url":"https://api.github.com/users/MrYsLab/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MrYsLab/subscriptions","organizations_url":"https://api.github.com/users/MrYsLab/orgs","repos_url":"https://api.github.com/users/MrYsLab/repos","events_url":"https://api.github.com/users/MrYsLab/events{/privacy}","received_events_url":"https://api.github.com/users/MrYsLab/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T13:37:49Z","updated_at":"2016-10-19T13:37:49Z","body":"Thanks. Another note - if I execute the generated code and add a print statement to the click handler, everything works correctly - the print is executed, so this seems to be limited to loading the file and not anything to do with the code generation. This is the case for both the button and slider."}}
{"actor":{"display_login":"MrYsLab"}}