File: Foo.py

package info (click to toggle)
scribes 0.4~r543-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 6,836 kB
  • ctags: 6,779
  • sloc: python: 32,963; perl: 2,747; xml: 2,233; sh: 847; makefile: 597
file content (36 lines) | stat: -rw-r--r-- 905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from SCRIBES.SignalConnectionManager import SignalManager

class Foo(SignalManager):

	def __init__(self, manager, editor):
		SignalManager.__init__(self)
		self.__init_attributes(manager, editor)
		self.connect(manager, "activate", self.__activate_cb)
		self.connect(manager, "destroy", self.__destroy_cb)

	def __init_attributes(self, manager, editor):
		self.__manager = manager
		self.__editor = editor
		return

	def __destroy(self):
		self.disconnect()
		del self
		return False

	def __foo(self):
		message = "Witness the awesome power of Foo!"
		title = "Foo Power"
		# Update the message bar.
		self.__editor.update_message(message, "yes", 10)
		# Show a window containing Foo message.
		self.__editor.show_info(title, message, self.__editor.window)
		return False

	def __activate_cb(self, *args):
		self.__foo()
		return False

	def __destroy_cb(self, *args):
		self.__destroy()
		return False