~juliank/software-center/debian

« back to all changes in this revision

Viewing changes to doc/example_plugin.py

  • Committer: Julian Andres Klode
  • Date: 2011-11-20 13:34:41 UTC
  • mfrom: (429.62.1824 software-center)
  • Revision ID: jak@debian.org-20111120133441-npw6j3nmd8v75yav
Merge from 2.0.7 up to 5.1.2 pre-release

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
from gi.repository import GObject
 
3
import sys
 
4
 
 
5
import softwarecenter.plugin
 
6
 
 
7
 
 
8
class ExamplePlugin(softwarecenter.plugin.Plugin):
 
9
    """ example plugin that will hide the exhibits banner """
 
10
 
 
11
    def _try_to_hide_banner(self):
 
12
        if not self.app.available_pane.view_initialized:
 
13
            # wait for the pane to fully initialize
 
14
            return True
 
15
        self.app.available_pane.cat_view.vbox.get_children()[0].hide()
 
16
        return False
 
17
 
 
18
    def init_plugin(self):
 
19
        sys.stderr.write("init_plugin\n")
 
20
 
 
21
        GObject.timeout_add(100, self._try_to_hide_banner)