~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to plug-ins/pygimp/gimpplugin.py

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2007-05-02 16:33:03 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070502163303-bvzhjzbpw8qglc4y
Tags: 2.3.16-1ubuntu1
* Resynchronized with Debian, remaining Ubuntu changes:
  - debian/rules: i18n magic.
* debian/control.in:
  - Maintainer: Ubuntu Core Developers <ubuntu-devel@lists.ubuntu.com>
* debian/patches/02_help-message.patch,
  debian/patches/03_gimp.desktop.in.in.patch,
  debian/patches/10_dont_show_wizard.patch: updated.
* debian/patches/04_composite-signedness.patch,
  debian/patches/05_add-letter-spacing.patch: dropped, used upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
# A plugin using this module would look something like this:
27
27
#
28
28
#   import gimp, gimpplugin
 
29
#
29
30
#   pdb = gimp.pdb
 
31
#
30
32
#   class myplugin(gimpplugin.plugin):
31
 
#           def query(self):
32
 
#                   gimp.install_procedure("plug_in_mine", ...)
33
 
#           def plug_in_mine(self, par1, par2, par3,...):
34
 
#                   do_something()
35
 
#
36
 
#   if __name__ == '__main__': myplugin().start()
 
33
#       def query(self):
 
34
#           gimp.install_procedure("plug_in_mine", ...)
 
35
#
 
36
#       def plug_in_mine(self, par1, par2, par3,...):
 
37
#           do_something()
 
38
#
 
39
#   if __name__ == '__main__':
 
40
#       myplugin().start()
37
41
 
38
42
import gimp
39
43
 
40
44
class plugin:
41
45
    def start(self):
42
46
        gimp.main(self.init, self.quit, self.query, self._run)
 
47
 
43
48
    def init(self):
44
49
        pass
 
50
 
45
51
    def quit(self):
46
52
        pass
 
53
 
47
54
    def query(self):
48
55
        pass
 
56
 
49
57
    def _run(self, name, params):
50
58
        if hasattr(self, name):
51
 
            apply(getattr(self, name), params)
 
59
            return apply(getattr(self, name), params)
52
60
        else:
53
61
            raise AttributeError, name
54
62
 
55
 
if __name__ == '__main__': plugin().start()
 
63
if __name__ == '__main__':
 
64
    plugin().start()