From: <ba...@us...> - 2007-05-09 22:56:42
|
Revision: 456 http://svn.sourceforge.net/omc/?rev=456&view=rev Author: bartw Date: 2007-05-09 15:56:36 -0700 (Wed, 09 May 2007) Log Message: ----------- changed to match new datetime functionality in pywbem Modified Paths: -------------- tools/trunk/yawn/yawn.py Modified: tools/trunk/yawn/yawn.py =================================================================== --- tools/trunk/yawn/yawn.py 2007-04-30 20:56:35 UTC (rev 455) +++ tools/trunk/yawn/yawn.py 2007-05-09 22:56:36 UTC (rev 456) @@ -29,7 +29,7 @@ # @author Norm Paxton <np...@no...> from mod_python import Cookie, apache -from datetime import datetime, timedelta +from datetime import timedelta import pywbem import cgi import types @@ -66,31 +66,9 @@ rval+= strItem rval+= '}' return cgi.escape(rval) - elif type(x) == datetime: - #http://windowssdk.msdn.microsoft.com/en-us/library/ms739696.aspx - rval = x.strftime('%Y%m%d%H%M%S') - mss = str(x.microsecond) - while len(mss) < 6: - mss = '0' + mss - rval += '.'+mss - uoff = x.utcoffset() - if uoff is None: - uoff = '+000' - else: - # make it fit in three digits - uoff = uoff.days*24*60 + uoff.seconds/60 - if uoff < -(60*12): - uoff = 24*60 + uoff - if uoff > (60*12): - uoff = uoff - 60*24 - neg = uoff < 0 - uoff = str(abs(uoff)) - while len(uoff) < 3: - uoff = '0'+uoff - uoff = neg and '-'+uoff or '+'+uoff - return cgi.escape(rval + uoff) elif type(x) == timedelta: - #http://windowssdk.msdn.microsoft.com/en-us/library/ms744132.aspx + #http://msdn2.microsoft.com/en-us/library/aa387237.aspx + #http://msdn2.microsoft.com/en-us/library/aa390895.aspx mss = str(x.microseconds) while len(mss) < 6: mss = '0' + mss @@ -413,7 +391,8 @@ req.write('<hr><h2>Objects of Class: ' + assocInstPath.classname + '</h2>') _printInstanceNames(req, urlargs, [assocInstPath]) elif assocCall=='References': - refs = conn.References(instName, **params)#, properties) + refs = _ex(req,conn.References,ObjectName=instName, + **params)#, properties) req.write('Showing ' + `len(refs)` + ' resulting object(s). <br><br>') for ref in refs: assocInstPath = ref.path This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |