comparison cagou/plugins/plugin_transfer_file.py @ 312:772c170b47a9

Python3 port: /!\ Cagou now runs with Python 3.6+ Port has been done in the same way as for backend (check backend commit b2d067339de3 message for details).
author Goffi <goffi@goffi.org>
date Tue, 13 Aug 2019 19:14:22 +0200
parents 1b835bcfa663
children 4d660b252487
comparison
equal deleted inserted replaced
311:a0d978d3ce84 312:772c170b47a9
29 29
30 log = logging.getLogger(__name__) 30 log = logging.getLogger(__name__)
31 31
32 32
33 PLUGIN_INFO = { 33 PLUGIN_INFO = {
34 "name": _(u"file"), 34 "name": _("file"),
35 "main": "FileTransmitter", 35 "main": "FileTransmitter",
36 "description": _(u"transmit a local file"), 36 "description": _("transmit a local file"),
37 "icon_medium": u"{media}/icons/muchoslava/png/fichier_50.png", 37 "icon_medium": "{media}/icons/muchoslava/png/fichier_50.png",
38 } 38 }
39 39
40 40
41 class FileChooserBox(BoxLayout): 41 class FileChooserBox(BoxLayout):
42 callback = properties.ObjectProperty() 42 callback = properties.ObjectProperty()
64 self.add_widget(FileChooserBox(default_path = self.default_path, 64 self.add_widget(FileChooserBox(default_path = self.default_path,
65 callback=self.onFiles, 65 callback=self.onFiles,
66 cancel_cb=partial(self.cancel_cb, self))) 66 cancel_cb=partial(self.cancel_cb, self)))
67 67
68 def _nativeFileChooser(self, *args, **kwargs): 68 def _nativeFileChooser(self, *args, **kwargs):
69 title=_(u"Please select a file to upload") 69 title=_("Please select a file to upload")
70 files = filechooser.open_file(title=title, 70 files = filechooser.open_file(title=title,
71 path=self.default_path, 71 path=self.default_path,
72 multiple=False, 72 multiple=False,
73 preview=True) 73 preview=True)
74 # we want to leave the thread when calling onFiles, so we use Clock 74 # we want to leave the thread when calling onFiles, so we use Clock