PageRenderTime 15ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/xdb/template.py

http://pyaimt.googlecode.com/
Python | 74 lines | 39 code | 11 blank | 24 comment | 1 complexity | c46c0f99c68e5684281b7a0a795f707e MD5 | raw file
 1# Copyright 2005-2006 Daniel Henninger <jadestorm@nc.rr.com>
 2# Licensed for distribution under the GPL version 2, check COPYING for details
 3#
 4# This is a template for any new XDB drivers that might be written.
 5#
 6
 7class XDB:
 8	"""
 9	Class for storage of data.
10	"""
11	def __init__(self, name):
12		""" Creates an XDB object. """
13		# Do whatever setup type stuff you might need
14
15	def getRegistration(self, jabberID):
16		""" Retrieve registration information from the XDB.
17		Returns a username and password. """
18		return None
19
20	def getRegistrationList(self):
21		""" Returns an array of all of the registered jids. """
22		return []
23
24	def setRegistration(self, jabberID, username, password):
25		""" Sets up or creates a registration in the XDB.
26		username and password are for the legacy account. """
27		pass
28
29	def removeRegistration(self, jabberID):
30		""" Removes a registration from the XDB. """
31		pass
32
33	def getSettingList(self, jabberID):
34		""" Gets a list of all settings for a user from the XDB. """
35		return {}
36
37	def getSetting(self, jabberID, variable):
38		""" Gets a user setting from the XDB. """
39		return None
40
41	def setSetting(self, jabberID, variable, value):
42		""" Sets a user setting in the XDB. """
43		pass
44
45	def getListTypes(self, jabberID):
46		""" Returns an array containing a list of all list types
47		associated with a user. """
48		return []
49
50	def getListEntry(self, namespace, jabberID, legacyID):
51		""" Retrieves a legacy ID entry from a list in
52		the XDB, based off the namespace and jabberID you provide. """
53		return None
54
55	def getList(self, namespace, jabberID):
56		""" Retrieves an array containing an entire list of a
57		 jabberID's from the XDB, based off the namespace and jabberID
58		you provide. """
59		return None
60
61	def setListEntry(self, namespace, jabberID, legacyID, payload = {}):
62		""" Updates or adds a legacy ID entry to a list in
63		the XDB, based off the namespace and jabberID you provide. """
64		pass
65
66	def removeListEntry(self, namespace, jabberID, legacyID):
67		""" Removes a legacy ID entry from a list in
68		the XDB, based off the namespace and jabberID you provide. """
69		pass
70
71
72def housekeep():
73	""" Perform cleanup type tasks upon startup. """
74	pass