From 44162de76c5849004e659da58df690cddbe8f7a4 Mon Sep 17 00:00:00 2001 From: helmutm Date: Thu, 10 Apr 2008 13:29:06 +0000 Subject: [PATCH] create cybertools.meta package for managing configuration options and other meta and control data git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2514 fd906abe-77d9-0310-91a1-e0d9ade77398 --- meta/README.txt | 12 ++++++++++++ meta/__init__.py | 3 +++ meta/config.py | 38 ++++++++++++++++++++++++++++++++++++++ meta/interfaces.py | 31 +++++++++++++++++++++++++++++++ meta/tests.py | 28 ++++++++++++++++++++++++++++ 5 files changed, 112 insertions(+) create mode 100644 meta/README.txt create mode 100644 meta/__init__.py create mode 100644 meta/config.py create mode 100644 meta/interfaces.py create mode 100755 meta/tests.py diff --git a/meta/README.txt b/meta/README.txt new file mode 100644 index 0000000..2822ef8 --- /dev/null +++ b/meta/README.txt @@ -0,0 +1,12 @@ +=========================== +Meta Information Management +=========================== + + ($Id$) + + +Configuration Options, Settings, Preferences +============================================ + + >>> from cybertools.meta.config import Options + diff --git a/meta/__init__.py b/meta/__init__.py new file mode 100644 index 0000000..38314f3 --- /dev/null +++ b/meta/__init__.py @@ -0,0 +1,3 @@ +""" +$Id$ +""" diff --git a/meta/config.py b/meta/config.py new file mode 100644 index 0000000..071e543 --- /dev/null +++ b/meta/config.py @@ -0,0 +1,38 @@ +# +# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Basic implementations for configuration options + +$Id$ +""" + +from zope.component import adapts +from zope.interface import implements, Interface + +from cybertools.meta.interfaces import IOptions + + +class Options(object): + + implements(IOptions) + adapts(Interface) + + def __init__(self, context): + self.context = context + diff --git a/meta/interfaces.py b/meta/interfaces.py new file mode 100644 index 0000000..039aa48 --- /dev/null +++ b/meta/interfaces.py @@ -0,0 +1,31 @@ +# +# Copyright (c) 2008 Helmut Merz helmutm@cy55.de +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# + +""" +Interfaces for the 'meta' package. + +$Id$ +""" + +from zope.interface import Interface, Attribute + + +class IOptions(Interface): + """ Provide a set of options (settings, configuration options, + preferences) based on a given context object. + """ diff --git a/meta/tests.py b/meta/tests.py new file mode 100755 index 0000000..971b22d --- /dev/null +++ b/meta/tests.py @@ -0,0 +1,28 @@ +#! /usr/bin/python + +""" +Tests for the 'cybertools.meta' package. + +$Id$ +""" + +import unittest, doctest +from zope.testing.doctestunit import DocFileSuite + + +class Test(unittest.TestCase): + "Basic tests for the storage package." + + def testBasicStuff(self): + pass + + +def test_suite(): + flags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS + return unittest.TestSuite(( + unittest.makeSuite(Test), + DocFileSuite('README.txt', optionflags=flags), + )) + +if __name__ == '__main__': + unittest.main(defaultTest='test_suite')