update doc

This commit is contained in:
2013-09-10 21:04:12 +02:00
parent 3dc72c505c
commit 28ea4f0e90
11 changed files with 355 additions and 27 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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)

View File

@ -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'