Ubuntu – detailed API documentation on the python binding for appindicator


I'm getting serous with a project of my own and need a good documentation on the appindicator module for python. What I've found so far:

  1. API documentation on dev.ubuntu.com
  2. Community wiki entry
  3. API documentation on the C code
  4. Nice blog post

what's wrong with them:

  1. Just a list with no explanations on the arguments, returns and on what the methods do
  2. Only design considerations and backgrounds – little that would help with actual programming
  3. Stuff missing the python module has (e.g. create_menu_from_desktop)
  4. Much useful information compressed but not complete

So basically I need something as detailed as 3. but for the python module.

Example on my problem:

void build_menu_from_desktop (desktop_file, desktop_profile)

What's are the arguments supposed to be and what does the method do? My guess is, the method creates menu entries from a '*.desktop' file. But if so, why does it need more arguments than just that file? Which entries in the file does it take the menu items from? It's questions like this I'm having a bit of a hard time finding an answer for.

Best Answer

Yes, we realize that we need Python documentation with the appropriate level of detail. That is the goal of the Giraffe project. It will work with the GObject Introspection bindings which is the way that new Python applications should be written to use the application indicators.

Until then, the best bet is the API documentation that you've noted. It should be roughly the same though "python-ified".

The build_menu_from_desktop is a convenience function use load the entries that would otherwise be in something like a quicklist in Unity. So to get those entries you'd use build_menu_from_desktop("/my/path/myfile.desktop", "Unity") to specify the TargetEnvironment.

This allows you to have different entries in the desktop file and have some overlap and others not.