Code: Select all
M_JSON = "application/json"
if result != None:
if hasattr(func, "contentType"):
contentType = func.contentType
if contentType == M_JSON:
response = types.jsonDumps(result)
else:
response = func.format % result
else:
response = resultCode: Select all
_MAPPING = [[], [], []]
_MAPPING[1] = ["V33", "V50", 0, "V50", 1, "GND", 4, 14, "GND", 15, 17, 18, 21, "GND", 22, 23, "V33", 24, 10, "GND", 9, 25, 11, 8, "GND", 7]
_MAPPING[2] = ["V33", "V50", 2, "V50", 3, "GND", 4, 14, "GND", 15, 17, 18, 27, "GND", 22, 23, "V33", 24, 10, "GND", 9, 25, 11, 8, "GND", 7]
MAPPING = _MAPPING[BOARD_REVISION]
elif relativePath == "map":
json = "%s" % MAPPING
json = json.replace("'", '"')
return (200, json, M_JSON)finally
Code: Select all
import re
rc = re.compile("Revision\s*:\s(.*)\n")