update doc
This commit is contained in:
@ -19,11 +19,9 @@
|
||||
# the whole pypy projet is under MIT licence
|
||||
# ____________________________________________________________
|
||||
|
||||
"""Storage connections, executions and managements.
|
||||
|
||||
Storage is basic components used to set Config informations in DB.
|
||||
The primary "entry point" class into this package is the StorageType and it's
|
||||
public configurator ``set_storage()``.
|
||||
"""Storage is basic components used to set Config informations in DB.
|
||||
The primary "entry point" class is the StorageType and it's public
|
||||
configurator ``set_storage()``.
|
||||
"""
|
||||
|
||||
|
||||
@ -43,6 +41,8 @@ class StorageType(object):
|
||||
|
||||
def set(self, name):
|
||||
if self.storage_type is not None:
|
||||
if self.storage_type == name:
|
||||
return
|
||||
raise ConfigError(_('storage_type is already set, cannot rebind it'))
|
||||
self.storage_type = name
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"default plugin for storage: set it in a simple dictionary"
|
||||
# Copyright (C) 2013 Team tiramisu (see AUTHORS for all contributors)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -17,8 +16,16 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# ____________________________________________________________
|
||||
"""Default plugin for storage. All informations are store in a simple
|
||||
dictionary in memory.
|
||||
|
||||
You cannot have persistente informations with this kind of storage.
|
||||
|
||||
The advantage of this solution is that you can easily create a Config and
|
||||
use it. But if something goes wrong, you will lost your modifications.
|
||||
"""
|
||||
from .value import Values
|
||||
from .setting import Settings
|
||||
from .storage import Storage, list_sessions, delete_session
|
||||
from .storage import Setting, Storage, list_sessions, delete_session
|
||||
|
||||
__all__ = (Values, Settings, Storage, list_sessions, delete_session)
|
||||
__all__ = (Setting, Values, Settings, Storage, list_sessions, delete_session)
|
||||
|
@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"default plugin for storage: set it in a simple dictionary"
|
||||
# Copyright (C) 2013 Team tiramisu (see AUTHORS for all contributors)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -22,6 +21,8 @@ from tiramisu.error import ConfigError
|
||||
|
||||
|
||||
class Setting(object):
|
||||
"""Dictionary storage has no particular setting.
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
|
@ -1,5 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"set storage in sqlite3"
|
||||
# Copyright (C) 2013 Team tiramisu (see AUTHORS for all contributors)
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
@ -17,8 +16,14 @@
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# ____________________________________________________________
|
||||
"""Sqlite3 plugin for storage. This storage is not made to be used in productive
|
||||
environment. It was developing as proof of concept.
|
||||
|
||||
You should not configure differents Configs with same session_id.
|
||||
|
||||
"""
|
||||
from .value import Values
|
||||
from .setting import Settings
|
||||
from .storage import Storage, list_sessions, delete_session
|
||||
from .storage import Setting, Storage, list_sessions, delete_session
|
||||
|
||||
__all__ = (Values, Settings, Storage, list_sessions, delete_session)
|
||||
__all__ = (Setting, Values, Settings, Storage, list_sessions, delete_session)
|
||||
|
@ -25,6 +25,9 @@ from glob import glob
|
||||
|
||||
|
||||
class Setting(object):
|
||||
""":param extension: database file extension (by default: db)
|
||||
:param dir_database: root database directory (by default: /tmp)
|
||||
"""
|
||||
extension = 'db'
|
||||
dir_database = '/tmp'
|
||||
|
||||
|
Reference in New Issue
Block a user