class documentation

class StartFile(Application): (source)

View In Hierarchy

Application wrapper for os.startfile(). Can be used on windows to open files and URLs with the default application.
Method __eq__ Undocumented
Method __init__ Constructor
Method run This method is not supported by this class @raises NotImplementedError: always
Method spawn No summary
Method tryexec No summary
Class Variable key Undocumented
Class Variable name Undocumented

Inherited from Application:

Method __repr__ Undocumented
Method pipe Run the application in a sub-process and capture the output. Like run(), but connects to stdin and stdout for the sub-process.
Constant STATUS_OK Undocumented
Instance Variable cmd the command and arguments as a tuple or a string (when given as a string it will be parsed for quoted arguments)
Instance Variable tryexeccmd the command to check in tryexec(), if None fall back to first item of cmd
Static Method _lookup Lookup cmd in PATH
Method _checkargs Undocumented
Method _cmd Undocumented
def __eq__(self, other): (source)

Undocumented

def __init__(self): (source)
Constructor
Parameters
cmdthe command for the external application, either a string for the command, or a tuple or list with the command and arguments
tryexeccmdcommand to check in tryexec() as string. If None will default to cmd or the first item of cmd.
def run(self, args): (source)
This method is not supported by this class
Raises
NotImplementedErroralways
def spawn(self, args, callback=None): (source)
Start the application in the background and return immediately. This is used to start an external in parallel with zim that is not expected to exit immediatly, so we do not want to wait for it - e.g. a webbrowser to show an URL that was clicked.
Parameters
argsadditional arguments to give to the command as tuple or list
callback

optional callback can be used to trigger when the application exits. The signature is:

        callback(status, data)

where 'status' is the exit status of the process. The application object provides a constant 'STATUS_OK' which can be used to test if the application was successful or not.

dataadditional data for the callback
cwdthe folder to set as working directory for the command
Returns
the PID for the new process
def tryexec(self): (source)
Check if the executable exists without calling it. This method is used e.g. to decide what applications to show in the gui. Uses the tryexeccmd, or the first item of cmd as the executable name.
Returns
True when the executable was found

Undocumented