Проверка шаблона шины для iOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

generateContextFields.py 544B

11 kuukautta sitten
123456789101112131415161718
  1. from generation.fieldFormat import *
  2. def generateContextFields(c):
  3. fileName = f"{c.dir}/templates/context-field"
  4. lines = c.readFile(fileName)
  5. fmtPlain = lines[0]
  6. fmtRecent = lines[1]
  7. fields = []
  8. for key in c.structure.model.fields:
  9. values = c.structure.model.fields[key]
  10. fmt = fieldFormat(fmtPlain, fmtRecent, key, c.structure)
  11. ln = fmt \
  12. .replace("%NAME%", key) \
  13. .replace("%TYPE%", values[0])
  14. fields.append(ln)
  15. c.contextFields = "\n".join(fields)