class documentation

class DesktopEntryDict(SectionedConfigDict, Application): (source)

Known subclasses: zim.gui.applications.DesktopEntryFile, zim.gui.customtools.CustomToolDict

View In Hierarchy

Base class for DesktopEntryFile, defines most of the logic.

The following keys are supported:

  • %f: a single file path
  • %F: a list of file paths
  • %u: a single URL
  • %U: a list of URLs
  • %i: the icon as defined in the desktop entry, if any, prefixed with --icon
  • %c: the name from the desktop entry
  • %k: the file path for the desktop entry file

See parse_exec() for interpolating these keys. If the command does not contain any keys, the file paths or URLs to open are just appended to the command.

Method __init__ Constructor
Method get_pixbuf Get the application icon as a GdkPixbuf.Pixbuf. @param size: the icon size as gtk constant @returns: a pixbuf object or None
Method isvalid No summary
Method parse_exec No summary
Method update Same as dict.update()
Property cmd Undocumented
Property comment Undocumented
Property key Undocumented
Property name Undocumented
Property nodisplay Undocumented
Property tryexeccmd Undocumented
Class Variable _definitions Undocumented

Inherited from Application:

Method __eq__ Undocumented
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.
Method run No summary
Method spawn No summary
Method tryexec No summary
Constant STATUS_OK Undocumented
Static Method _lookup Lookup cmd in PATH
Method _checkargs Undocumented
Method _cmd 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 get_pixbuf(self, size): (source)
Get the application icon as a GdkPixbuf.Pixbuf.
Parameters
sizethe icon size as gtk constant
Returns
a pixbuf object or None
def isvalid(self): (source)
Check if all the fields that are required according to the specification are set. Assumes we only use desktop files to describe applications (and not links or dirs, which are also covered by the spec).
Returns
True if all required fields are set
def parse_exec(self, args=None): (source)
Parse the 'Exec' string and interpolate the arguments according to the keys of the desktop spec.
Parameters
argslist of either URLs or File objects
Returns
the full command to execute as a tuple
def update(self, E=(), **F): (source)
Same as dict.update()
@property
comment = (source)

Undocumented

@property
nodisplay = (source)

Undocumented

_definitions = (source)

Undocumented