Public Member Functions | Public Attributes | Private Attributes | List of all members
mycroft.util.download.Downloader Class Reference
Inheritance diagram for mycroft.util.download.Downloader:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, url, dest, complete_action=None, header=None)
 
def abort (self)
 
def cleanup (self, tmp)
 
def finalize (self, tmp)
 
def perform_download (self, dest)
 
def run (self)
 

Public Attributes

 complete_action
 
 daemon
 
 dest
 
 done
 
 header
 
 status
 
 url
 

Private Attributes

 _abort
 

Detailed Description

    Downloader is a thread based downloader instance when instanciated
    it will download the provided url to a file on disk.

    When the download is complete or failed the `.done` property will
    be set to true and the `.status` will indicate the status code.
    200 = Success.

    Args:
        url:            Url to download
        dest:           Path to save data to
        complet_action: Function to run when download is complete.
                        `func(dest)`

Definition at line 39 of file download.py.

Constructor & Destructor Documentation

def mycroft.util.download.Downloader.__init__ (   self,
  url,
  dest,
  complete_action = None,
  header = None 
)

Definition at line 55 of file download.py.

Member Function Documentation

def mycroft.util.download.Downloader.abort (   self)
    Abort download process

Definition at line 117 of file download.py.

def mycroft.util.download.Downloader.cleanup (   self,
  tmp 
)
    Cleanup after download attempt

Definition at line 108 of file download.py.

def mycroft.util.download.Downloader.finalize (   self,
  tmp 
)
    Move the .part file to the final destination and perform any
    actions that should be performed at completion.

Definition at line 99 of file download.py.

def mycroft.util.download.Downloader.perform_download (   self,
  dest 
)

Definition at line 73 of file download.py.

def mycroft.util.download.Downloader.run (   self)
    Does the actual download.

Definition at line 81 of file download.py.

Member Data Documentation

mycroft.util.download.Downloader._abort
private

Definition at line 62 of file download.py.

mycroft.util.download.Downloader.complete_action

Definition at line 59 of file download.py.

mycroft.util.download.Downloader.daemon

Definition at line 70 of file download.py.

mycroft.util.download.Downloader.dest

Definition at line 58 of file download.py.

mycroft.util.download.Downloader.done

Definition at line 61 of file download.py.

mycroft.util.download.Downloader.header

Definition at line 63 of file download.py.

mycroft.util.download.Downloader.status

Definition at line 60 of file download.py.

mycroft.util.download.Downloader.url

Definition at line 57 of file download.py.


The documentation for this class was generated from the following file:


mycroft_ros
Author(s):
autogenerated on Mon Apr 26 2021 02:35:41