platypush/plugins/esp/__init__.py
def file_download(self, source: str, destination: str, timeout: Optional[float] = 60.0, **kwargs):
        """
        Download a file from the board to the local machine.

        :param source: Name or path of the file to download from the device.
        :param destination: Target directory or path on the local machine.
        :param timeout: File transfer timeout (default: one minute).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
        destination = os.path.abspath(os.path.expanduser(destination))
        if os.path.isdir(destination):
            filename = os.path.basename(source)
            destination = os.path.join(destination, filename)

        device = self._get_device(**kwargs)
        host = device['host']
        port = device['port']
        self.connect(host=host, port=port, password=device['password'])
        conn = self._get_connection(host=host, port=port)

        with open(destination, 'wb') as f:
            conn.file_download(source, f, timeout=timeout)

        Download a file from the board to the local machine.

        :param source: Name or path of the file to download from the device.
        :param destination: Target directory or path on the local machine.
        :param timeout: File transfer timeout (default: one minute).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        
Download a file from the board to the local machine.
Download a file from the board to the local machine .
def file_download(self, source: str, destination: str, timeout: Optional[float] = 60.0, **kwargs):
        destination = os.path.abspath(os.path.expanduser(destination))
        if os.path.isdir(destination):
            filename = os.path.basename(source)
            destination = os.path.join(destination, filename)
        device = self._get_device(**kwargs)
        host = device['host']
        port = device['port']
        self.connect(host=host, port=port, password=device['password'])
        conn = self._get_connection(host=host, port=port)
        with open(destination, 'wb') as f:
            conn.file_download(source, f, timeout=timeout)
def file_download ( self , source : str , destination : str , timeout : Optional [ float ] = 60.0 , ** kwargs ) : destination = os . path . abspath ( os . path . expanduser ( destination ) ) if os . path . isdir ( destination ) : filename = os . path . basename ( source ) destination = os . path . join ( destination , filename ) device = self . _get_device ( ** kwargs ) host = device [ 'host' ] port = device [ 'port' ] self . connect ( host = host , port = port , password = device [ 'password' ] ) conn = self . _get_connection ( host = host , port = port ) with open ( destination , 'wb' ) as f : conn . file_download ( source , f , timeout = timeout )
Download a file from the board to the local machine.
Download a file from the board to the local machine .
"""
        Download a file from the board to the local machine.

        :param source: Name or path of the file to download from the device.
        :param destination: Target directory or path on the local machine.
        :param timeout: File transfer timeout (default: one minute).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
self
source
str
Name or path of the file to download from the device.
Name or path of the file to download from the device .
destination
str
Target directory or path on the local machine.
Target directory or path on the local machine .
timeout
Optional[float]
File transfer timeout (default: one minute).
File transfer timeout ( default : one minute ) .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . execute ` .