comparison cagou/core/platform_/base.py @ 491:203755bbe0fe

massive refactoring from camelCase -> snake_case. See backend commit log for more details
author Goffi <goffi@goffi.org>
date Sat, 08 Apr 2023 13:44:32 +0200
parents 3c9ba4a694ef
children
comparison
equal deleted inserted replaced
490:962d17c4078c 491:203755bbe0fe
48 pass 48 pass
49 49
50 def on_host_init(self, host): 50 def on_host_init(self, host):
51 pass 51 pass
52 52
53 def on_initFrontendState(self): 53 def on_init_frontend_state(self):
54 pass 54 pass
55 55
56 def do_postInit(self): 56 def do_post_init(self):
57 return True 57 return True
58 58
59 def on_pause(self): 59 def on_pause(self):
60 pass 60 pass
61 61
77 def _on_new_window(self): 77 def _on_new_window(self):
78 """Launch a new instance of Cagou to have an extra window""" 78 """Launch a new instance of Cagou to have an extra window"""
79 subprocess.Popen(sys.argv) 79 subprocess.Popen(sys.argv)
80 80
81 def on_extra_menu_init(self, extra_menu): 81 def on_extra_menu_init(self, extra_menu):
82 extra_menu.addItem(_('new window'), self._on_new_window) 82 extra_menu.add_item(_('new window'), self._on_new_window)
83 83
84 def updateParamsExtra(self, extra): 84 def update_params_extra(self, extra):
85 pass 85 pass
86 86
87 def check_plugin_permissions(self, plug_info, callback, errback): 87 def check_plugin_permissions(self, plug_info, callback, errback):
88 """Check that plugin permissions for this platform are granted""" 88 """Check that plugin permissions for this platform are granted"""
89 callback() 89 callback()
114 """ 114 """
115 parsed_url = parse.urlparse(url) 115 parsed_url = parse.urlparse(url)
116 if parsed_url.scheme == "aesgcm" and wid is not None: 116 if parsed_url.scheme == "aesgcm" and wid is not None:
117 # aesgcm files need to be decrypted first 117 # aesgcm files need to be decrypted first
118 # so we download them before opening 118 # so we download them before opening
119 quick_widget = G.host.getAncestorWidget(wid, QuickWidget) 119 quick_widget = G.host.get_ancestor_widget(wid, QuickWidget)
120 if quick_widget is None: 120 if quick_widget is None:
121 msg = f"Can't find ancestor QuickWidget of {wid}" 121 msg = f"Can't find ancestor QuickWidget of {wid}"
122 log.error(msg) 122 log.error(msg)
123 G.host.errback(exceptions.InternalError(msg)) 123 G.host.errback(exceptions.InternalError(msg))
124 return 124 return
125 G.host.downloadURL( 125 G.host.download_url(
126 parsed_url, self.open_url, G.host.errback, profile=quick_widget.profile 126 parsed_url, self.open_url, G.host.errback, profile=quick_widget.profile
127 ) 127 )
128 else: 128 else:
129 self._open(url) 129 self._open(url)