Package lemon :: Package external :: Package Cheetah :: Package Utils :: Module Misc
[show private | hide private]
[frames | no frames]

Module lemon.external.Cheetah.Utils.Misc

Miscellaneous functions/objects used by Cheetah but also useful standalone.

Meta-Data
================================================================================
Author: Mike Orr <iron@mso.oz.net>
License: This software is released for unlimited distribution under the
         terms of the Python license.
Version: $Revision: 1.1 $
Start Date: 2001/11/07
Last Revision Date: $Date: 2003/08/12 09:17:11 $

Function Summary
  checkKeywords(dic, legalKeywords, what)
Verify no illegal keyword arguments were passed to a function.
  die(reason)
  mkdirsWithPyInitFiles(path)
Same as os.makedirs (mkdir 'path' and all missing parent directories) but also puts a Python '__init__.py' file in every directory it creates.
  removeFromList(list_, *elements)
Save as list_.remove(each element) but don't raise an error if element is missing.
  useOrRaise(thing, errmsg)
Raise 'thing' if it's a subclass of Exception.

Variable Summary
str __author__ = 'Mike Orr <iron@mso.oz.net>'
str __revision__ = '1.1'

Function Details

checkKeywords(dic, legalKeywords, what='argument')

Verify no illegal keyword arguments were passed to a function.

in : dic, dictionary (**kw in the calling routine).
     legalKeywords, list of strings, the keywords that are allowed.
     what, string, suffix for error message (see function source).
out: None.
exc: TypeError if 'dic' contains a key not in 'legalKeywords'.
called by: Cheetah.Template.__init__()

mkdirsWithPyInitFiles(path)

Same as os.makedirs (mkdir 'path' and all missing parent directories)
but also puts a Python '__init__.py' file in every directory it
creates.  Does nothing (without creating an '__init__.py' file) if the
directory already exists.

removeFromList(list_, *elements)

Save as list_.remove(each element) but don't raise an error if
element is missing.  Modifies 'list_' in place!  Returns None.

useOrRaise(thing, errmsg='')

Raise 'thing' if it's a subclass of Exception.  Otherwise return it.

Called by: Cheetah.Servlet.cgiImport()

Variable Details

__author__

Type:
str
Value:
'Mike Orr <iron@mso.oz.net>'                                           

__revision__

Type:
str
Value:
'1.1'                                                                  

Generated by Epydoc 2.0 on Mon Nov 10 15:08:02 2003 http://epydoc.sf.net