Moved the packing of XML tree into NWTree, and added a function for formatting time stamps
This commit is contained in:
@@ -28,6 +28,10 @@
|
||||
import logging
|
||||
import nw
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from nw.constants import nwConst
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
def checkString(checkValue, defaultValue, allowNone=False):
|
||||
@@ -122,6 +126,12 @@ def formatInt(theInt):
|
||||
|
||||
return "%d" % theInt
|
||||
|
||||
def formatTimeStamp(theTime, fileSafe=False):
|
||||
if fileSafe:
|
||||
return datetime.fromtimestamp(theTime).strftime(nwConst.fStampFmt)
|
||||
else:
|
||||
return datetime.fromtimestamp(theTime).strftime(nwConst.tStampFmt)
|
||||
|
||||
def splitVersionNumber(vString):
|
||||
""" Splits a version string on the form aa.bb.cc into major, minor
|
||||
and patch, and computes an integer value aabbcc.
|
||||
|
||||
Reference in New Issue
Block a user