StorageFactory.py
Go to the documentation of this file.00001
00002
00003
00004
00005 import GOError
00006 import Storage
00007
00008
00009
00010
00011 class StorageFactory:
00012 __state = {}
00013
00014 def __init__(self):
00015 self.__dict__ = self.__state
00016
00017
00018
00019
00020
00021
00022
00023 @classmethod
00024 def makeStorage(klass, stype, *args, **kwargs):
00025 error = GOError.GOError()
00026 if stype == Storage.Types.MYSQL:
00027 return Storage.MysqlStorage(*args, **kwargs)
00028 elif stype == Storage.Types.FILEBASED:
00029 return Storage.FilebasedStorage(*args, **kwargs)
00030 else:
00031 error.handleFatal("Attept to create non existant storage in the factory: %s" % stype)