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
This commit is contained in:
		
							parent
							
								
									4004ebd1cb
								
							
						
					
					
						commit
						44162de76c
					
				
					 5 changed files with 112 additions and 0 deletions
				
			
		
							
								
								
									
										12
									
								
								meta/README.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								meta/README.txt
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,12 @@
 | 
			
		|||
===========================
 | 
			
		||||
Meta Information Management
 | 
			
		||||
===========================
 | 
			
		||||
 | 
			
		||||
  ($Id$)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Configuration Options, Settings, Preferences
 | 
			
		||||
============================================
 | 
			
		||||
 | 
			
		||||
  >>> from cybertools.meta.config import Options
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										3
									
								
								meta/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								meta/__init__.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,3 @@
 | 
			
		|||
"""
 | 
			
		||||
$Id$
 | 
			
		||||
"""
 | 
			
		||||
							
								
								
									
										38
									
								
								meta/config.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										38
									
								
								meta/config.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										31
									
								
								meta/interfaces.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								meta/interfaces.py
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -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.
 | 
			
		||||
    """
 | 
			
		||||
							
								
								
									
										28
									
								
								meta/tests.py
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										28
									
								
								meta/tests.py
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -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')
 | 
			
		||||
		Loading…
	
	Add table
		
		Reference in a new issue