Trees | Index | Help |
|
---|
Package ZenUtils :: Module Utils |
|
Utils
General Utility function module
$Id: Utils.py,v 1.15 2004/04/04 02:22:38 edahl Exp $Classes | |
---|---|
HtmlFormatter |
Function Summary | |
---|---|
add the username and password to a url in the form http://username:password@host/path | |
perform issubclass using class name as string | |
take the trailing off the end of a string | |
cleanupSkins(dmd)
| |
Clear our web logger. | |
Check to see if any of an object's base classes are in a list of class names. | |
Convert a number to its human readable form. | |
Create a hierarchy object from its path we use relpath to skip down any missing relations in the path and factory is the constructor for this object. | |
get all ZenModelRM objects in database | |
Return an object using its path relations are optional in the path. | |
Get a Zope object by its path (e.g. | |
do a depth first search looking for objects that the function filter returns as true. | |
do a depth first search looking for objects that the function filter returns as true. | |
Import a class from the module given. | |
Test to see if ips on an in should not be included in the network map. | |
Test to see if ip it should not be included in the network map. | |
look in sys.modules for our class | |
build and return the path to an object based on a hierarchical name (ex /Mail/Mta) relative to the root passed in. | |
Make an id with valid url characters. | |
resequence(context,
objects,
seqmap,
origseq,
REQUEST)
| |
Send an email. | |
Send a page. | |
Setup logging to log to a browser using a request object. | |
walk a series of to one rels collecting collectname into collect | |
zdecode(context,
value)
| |
build a zenpath in its string form | |
split a zen path and clean up any blanks or bogus spaces in it |
Variable Summary | |
---|---|
str |
__version__ = '1.15'
|
Logger |
log = <logging.Logger instance at 0x281e738>
|
Function Details |
---|
basicAuthUrl(username, password, url)add the username and password to a url in the form http://username:password@host/path |
checkClass(myclass, className)perform issubclass using class name as string |
cleanstring(value)take the trailing off the end of a string |
clearWebLoggingStream(handler)Clear our web logger. |
cmpClassNames(obj, classnames)Check to see if any of an object's base classes are in a list of class names. Like isinstance(), but without requiring a class to compare against. |
convToUnits(numb, divby=1024.0)Convert a number to its human readable form. ie: 4GB, 4MB, etc. |
createHierarchyObj(root, name, factory, relpath='', llog=None)Create a hierarchy object from its path we use relpath to skip down any missing relations in the path and factory is the constructor for this object. |
getAllConfmonObjects(base)get all ZenModelRM objects in database |
getHierarchyObj(root, name, relpath=None)Return an object using its path relations are optional in the path. |
getObjByPath(base, path, restricted=0)Get a Zope object by its path (e.g. '/Devices/Server/Linux'). Mostly a stripdown of unrestrictedTraverse method from Zope 2.8.8. |
getSubObjects(base, filter=None, decend=None, retobjs=None)do a depth first search looking for objects that the function filter returns as true. If decend is passed it will check to see if we should keep going down or not |
getSubObjectsMemo(base, filter=None, decend=None, memo={})do a depth first search looking for objects that the function filter returns as true. If decend is passed it will check to see if we should keep going down or not |
importClass(modulePath, classname='')Import a class from the module given. |
localInterfaceCheck(context, intname)Test to see if ips on an in should not be included in the network map. |
localIpCheck(context, ip)Test to see if ip it should not be included in the network map. |
lookupClass(productName, classname=None)look in sys.modules for our class |
OLDgetHierarchyObj(root, name, factory, lastfactory=None, relpath=None, lastrelpath=None, llog=None)build and return the path to an object based on a hierarchical name (ex /Mail/Mta) relative to the root passed in. If lastfactory is passed the leaf object will be created with it instead of factory. relpath is the relationship within which we will recurse as objects are created. Having the relationship in the path passed is optional. |
prepId(id, subchar='_')Make an id with valid url characters. Subs [^a-zA-Z0-9-_,.$\(\) ] with subchar. If id then starts with subchar it is removed. |
sendEmail(emsg, host, port=25, usetls=0, usr='', pwd='')Send an email. Return a tuple: (sucess, message) where sucess is True or False. |
sendPage(recipient, msg, snppHost, snppPort)Send a page. Return a tuple: (success, message) where sucess is True or False. |
setWebLoggingStream(stream)Setup logging to log to a browser using a request object. |
travAndColl(obj, toonerel, collect, collectname)walk a series of to one rels collecting collectname into collect |
zenpathjoin(pathar)build a zenpath in its string form |
zenpathsplit(pathstring)split a zen path and clean up any blanks or bogus spaces in it |
Variable Details |
---|
__version__
|
log
|
Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Thu Aug 16 09:55:10 2007 | http://epydoc.sf.net |