Back to index

plone3  3.1.7
Functions | Variables
ATContentTypes.configuration.schema Namespace Reference

Functions

def loadSchema

Variables

string __author__ = 'Christian Heimes <tiran@cheimes.de>'
string __docformat__ = 'restructuredtext'
tuple DIR = os.path.dirname(os.path.abspath(__file__))
string SCHEMA_FILE_NAME = 'schema.xml'
tuple SCHEMA_FILE = os.path.join(DIR, SCHEMA_FILE_NAME)
tuple atctRegistry = Registry()
 atctSchema = None
tuple __all__ = ('atctSchema',)

Function Documentation

def ATContentTypes.configuration.schema.loadSchema (   file,
  registry = atctRegistry,
  overwrite = False 
)
Loads a schema file

* file
  A path to a file
* registry
  A ZConfig datatypes registry instance
* overwrite
  Overwriting the existing global schema is not possible unless overwrite
  is set to true. Useful only for unit testing.

Definition at line 49 of file schema.py.

00049 
00050 def loadSchema(file, registry=atctRegistry, overwrite=False):
00051     """Loads a schema file
00052     
00053     * file
00054       A path to a file
00055     * registry
00056       A ZConfig datatypes registry instance
00057     * overwrite
00058       Overwriting the existing global schema is not possible unless overwrite
00059       is set to true. Useful only for unit testing.
00060     """
00061     global atctSchema
00062     if atctSchema is not None and not overwrite:
00063         raise RuntimeError, 'Schema is already loaded'
00064     schemaLoader = SchemaLoader(registry=registry)
00065     atctSchema = schemaLoader.loadURL(file)
00066     return atctSchema
00067 
00068 loadSchema(SCHEMA_FILE)


Variable Documentation

Definition at line 69 of file schema.py.

string ATContentTypes.configuration.schema.__author__ = 'Christian Heimes <tiran@cheimes.de>'

Definition at line 22 of file schema.py.

Definition at line 23 of file schema.py.

Definition at line 39 of file schema.py.

Definition at line 48 of file schema.py.

tuple ATContentTypes.configuration.schema.DIR = os.path.dirname(os.path.abspath(__file__))

Definition at line 32 of file schema.py.

Definition at line 34 of file schema.py.

Definition at line 33 of file schema.py.