rox.AppInfo | index

`Parse the AppInfo files.
Written by Christopher Arndt and Stephen Watson.`

Classes

``

AppInfo

class AppInfo
`` | `Parsed AppInfo.xml file. Current only deals with the <About>, <Summary> and <AppMenu> elements`

Methods defined here:

__init__(self, source)
  `Read the file and parse the <About> element.`

findElements(self, elname, ns=None)
  `Return all instances of the named element with an optional name
  space. They are returned as DOM objects.`

getAbout(self, elname, langs=None)
  `Return an entry from the <About> section.
  elname is the name of the element to return text from
  langs is a list of acceptable languages, or None to use
  rox.i18n.langs`

getAppMenu(self, langs=None)
  `Return list of all menu entries. Each item in the list is a
  dictionary with these keys:
  'option': the option to pass to the app for each item
  'label': the label of the item in an appropriate language
  'sub-menus': list of sub menu items`

getAuthors(self, langs=None)
  `Return the contents of the <Authors> element in the
  <About> section (also tries <Author> if needed.`

getCanRun(self)
  `Return list of named MIME types that this application declares
  it can handle.`

getCanThumbnail(self)
  `Return list of named MIME types that this application declares
  it can generate thumbnails for.`

getSummary(self, langs=None)
  `Return the content of the <Summary> element.
  langs is a list of acceptable languages, or None to use
  rox.i18n.langs`

setAbout(self, elname, value, lang)
  `Set the value of an element in the <About> section.
  If no element 'elname' is present in the <About> section with the
  matching 'lang' attribute, append a new one. If no such section
  exists yet, create it first.
  value must be a unicode string.`

setSummary(self, value, lang)
  `Set content of the Summary element with matching 'lang' attribute.
  If no such element is present, append a new one to the DOM object.
  value must be a unicode string.`

writeToFile(self, fname)