Products.MightyCal.Utils (version 1.12)
index
/home/zope/lib/python/Products/MightyCal/Utils.py

Library containing misc useful routines.  Currently the following routines are defined:
* addMethods: graft dtml documents onto the given object as callable methods.
* addImages: Bulk-add a set of images to a Folder, encapsulated as Zope Image objects.
* getFilesAsDictionary: For each file in a given directory, read them in and create a dictionary whose
  keys are the file names, and whose element contents are the file contents themselves.
* checkId: Figure out whether a given ID is URL-compatible.
* flattenDOM: Given a DOM tree, return a one-dimensional list containing all its nodes

 
Modules
            
OFS
os
re
string
sys

 
Classes
            
exceptions.Exception
IDException

 
class IDException
      # IDExceptions are raised by checkId when a non-URL compatible ID is specified.
 
  
__init__(self, id)
__str__(self)

 
Functions
            
addImages(object, imageDir, iconList)
Add the list of images as Zope Image objects to the given folder
checkId(id)
Check the user-supplied ID to make sure it will work as part of a URL
createSelect(selectName, valueTuples, defaultValue, styleAttr)
Create a dropdown using the specified display & actual values, with the specified default value starting out selected.
flattenDOM(node, list)
Given a DOM document (or document fragment), return a list containing all of its nodes
generateID(objType)
Create a semirandom ID for a given object type
getFilesAsDictionary(dirName)
Read the files in the given directory, and return a Dictionary consisting of of the filenames as keys and the file text as the element content
logException(module, routine, exceptionInfo)
Write a detailed report of the exception to the log file
nodeToNodeList(node)
Turn a single Node into a single-node NodeList
setIdFromName(objInstance)
Uses the __name__ attribute of an object to create its id attribute
zeroPad(number)
Return a number that is preceded by a zero if less than 10

 
Data
             INFO = 0

INSTANCE_HOME = '/home/zope'

SOFTWARE_HOME = '/home/zope/lib/python'

__file__ = '/home/zope/lib/python/Products/MightyCal/Utils.pyc'

__name__ = 'Products.MightyCal.Utils'

__version__ = '$Revision: 1.12 $'