Beispiel #1
0
 def fromXML(self, name, attrs, content, ttFont):
     value = attrs["value"]
     if name in ("FFTimeStamp", "sourceCreated", "sourceModified"):
         value = timestampFromString(value)
     else:
         value = safeEval(value)
     setattr(self, name, value)
Beispiel #2
0
	def fromXML(self, name, attrs, content, ttFont):
		value = attrs["value"]
		if name in ("FFTimeStamp", "sourceCreated", "sourceModified"):
			value = timestampFromString(value)
		else:
			value = safeEval(value)
		setattr(self, name, value)
Beispiel #3
0
	def fromXML(self, name, attrs, content, ttFont):
		value = attrs["value"]
		if name in ("created", "modified"):
			value = timestampFromString(value)
		elif name in ("macStyle", "flags"):
			value = binary2num(value)
		else:
			value = safeEval(value)
		setattr(self, name, value)
Beispiel #4
0
 def fromXML(self, name, attrs, content, ttFont):
     value = attrs["value"]
     if name in ("created", "modified"):
         value = timestampFromString(value)
     elif name in ("macStyle", "flags"):
         value = binary2num(value)
     else:
         value = safeEval(value)
     setattr(self, name, value)
Beispiel #5
0
def test_date_parsing_with_locale():
    l = locale.getlocale(locale.LC_TIME)
    try:
        locale.setlocale(locale.LC_TIME, 'de_DE.utf8')
    except locale.Error:
        pytest.skip("Locale de_DE not available")

    try:
        assert timestampFromString(timestampToString(timestampNow()))
    finally:
        locale.setlocale(locale.LC_TIME, l)
Beispiel #6
0
 def fromXML(self, name, attrs, content, ttFont):
     value = attrs["value"]
     fixes = sstruct.getformat(headFormat)[2]
     if name in fixes:
         value = strToFixedToFloat(value, precisionBits=fixes[name])
     elif name in ("created", "modified"):
         value = timestampFromString(value)
     elif name in ("macStyle", "flags"):
         value = binary2num(value)
     else:
         value = safeEval(value)
     setattr(self, name, value)