Mercurial > libervia-desktop-kivy
comparison cagou/plugins/plugin_wid_file_sharing.py @ 217:286f14127f61
plugin file sharing: started to limit line to 90 chars as a test
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 24 Jun 2018 22:08:57 +0200 |
parents | 6a98d70a3a66 |
children | a676cb07c1cb |
comparison
equal
deleted
inserted
replaced
216:e42e0c45d384 | 217:286f14127f61 |
---|---|
276 self.menu_item = None | 276 self.menu_item = None |
277 self.float_layout.bind(children=self.clean_fl_children) | 277 self.float_layout.bind(children=self.clean_fl_children) |
278 if not FileSharing.signals_registered: | 278 if not FileSharing.signals_registered: |
279 # FIXME: we use this hack (registering the signal for the whole class) now | 279 # FIXME: we use this hack (registering the signal for the whole class) now |
280 # as there is currently no unregisterSignal available in bridges | 280 # as there is currently no unregisterSignal available in bridges |
281 G.host.registerSignal("FISSharedPathNew", handler=FileSharing.shared_path_new, iface="plugin") | 281 G.host.registerSignal("FISSharedPathNew", |
282 G.host.registerSignal("FISSharedPathRemoved", handler=FileSharing.shared_path_removed, iface="plugin") | 282 handler=FileSharing.shared_path_new, |
283 iface="plugin") | |
284 G.host.registerSignal("FISSharedPathRemoved", | |
285 handler=FileSharing.shared_path_removed, | |
286 iface="plugin") | |
283 FileSharing.signals_registered = True | 287 FileSharing.signals_registered = True |
284 G.host.bridge.FISLocalSharesGet(self.profile, | 288 G.host.bridge.FISLocalSharesGet(self.profile, |
285 callback=self.fill_paths, | 289 callback=self.fill_paths, |
286 errback=G.host.errback) | 290 errback=G.host.errback) |
287 | 291 |
353 def discover_devices(self): | 357 def discover_devices(self): |
354 """Looks for devices handling file "File Information Sharing" and display them""" | 358 """Looks for devices handling file "File Information Sharing" and display them""" |
355 try: | 359 try: |
356 namespace = self.host.ns_map['fis'] | 360 namespace = self.host.ns_map['fis'] |
357 except KeyError: | 361 except KeyError: |
358 msg = _(u"can't find file information sharing namespace, is the plugin running?") | 362 msg = _(u"can't find file information sharing namespace, " |
363 u"is the plugin running?") | |
359 log.warning(msg) | 364 log.warning(msg) |
360 G.host.addNote(_(u"missing plugin"), msg, C.XMLUI_DATA_LVL_ERROR) | 365 G.host.addNote(_(u"missing plugin"), msg, C.XMLUI_DATA_LVL_ERROR) |
361 return | 366 return |
362 self.host.bridge.discoFindByFeatures( | 367 self.host.bridge.discoFindByFeatures( |
363 [namespace], [], False, True, True, True, False, self.profile, | 368 [namespace], [], False, True, True, True, False, self.profile, |
408 level=C.XMLUI_DATA_LVL_WARNING) | 413 level=C.XMLUI_DATA_LVL_WARNING) |
409 self.local_dir = expanduser(u'~') | 414 self.local_dir = expanduser(u'~') |
410 return | 415 return |
411 for f in files: | 416 for f in files: |
412 filepath = os.path.join(self.local_dir, f) | 417 filepath = os.path.join(self.local_dir, f) |
413 self.layout.add_widget(LocalPathWidget(sharing_wid=self, filepath=filepath)) | 418 self.layout.add_widget(LocalPathWidget(sharing_wid=self, |
419 filepath=filepath)) | |
414 elif self.mode == MODE_VIEW: | 420 elif self.mode == MODE_VIEW: |
415 if not self.remote_entity: | 421 if not self.remote_entity: |
416 self.discover_devices() | 422 self.discover_devices() |
417 else: | 423 else: |
418 # we always a way to go back | 424 # we always a way to go back |