Package tdi :: Module factory
[frames] | no frames]

Module factory

source code

Template Factories

Template Factories.


Copyright: Copyright 2006 - 2015 André Malo or his licensors, as applicable

License:

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Author: André Malo

Classes
  Loader
Template loader
  Factory
Template builder/loader factory
Functions
tuple
file_opener(filename, mtime, check_only=False)
File stream opener
source code
tdi.template.Template
overlay(templates)
Overlay a list of templates from left to right
source code
Variables
  __doc__ = __doc__.encode('ascii').decode('unicode_escape')
  __package__ = 'tdi'
Function Details

file_opener(filename, mtime, check_only=False)

source code 
File stream opener
Parameters:
  • filename (str) - Filename
  • mtime (int) - mtime to check. If it equals the file's mtime, stream is returned as None
  • check_only (bool) - Only check? In this case the returned "stream" is either True (update available) or False (mtime didn't change)
Returns: tuple
The stream and its mtime

overlay(templates)

source code 
Overlay a list of templates from left to right
Parameters:
  • templates (iterable) - Template list
Returns: tdi.template.Template
The final template

Variables Details

__doc__

Value:
__doc__.encode('ascii').decode('unicode_escape')

__package__

Value:
'tdi'