File: ConfigPlugin.py

package info (click to toggle)
yapsy 1.12.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 888 kB
  • sloc: python: 2,684; makefile: 82
file content (56 lines) | stat: -rw-r--r-- 931 bytes parent folder | download | duplicates (4)
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: t; python-indent: 4 -*-


"""
This is certainly the second simplest plugin ever.
"""

from yapsy.IPlugin import IPlugin

class ConfigPlugin(IPlugin):
	"""
	Try to use the methods with which it has been decorated.
	"""

	def __init__(self):
		"""
		init
		"""
		# initialise parent class
		IPlugin.__init__(self)


	def activate(self):
		"""
		Call the parent class's acivation method
		"""
		IPlugin.activate(self)
		return


	def deactivate(self):
		"""
		Just call the parent class's method
		"""
		IPlugin.deactivate(self)


	def choseTestOption(self, value):
		"""
		Set an option to a given value.
		"""
		self.setConfigOption("Test",value)

	def checkTestOption(self):
		"""
		Test if the test option is here.
		"""
		return self.hasConfigOption("Test")

	def getTestOption(self):
		"""
		Return the value of the test option.
		"""
		return self.getConfigOption("Test")