Проверка шаблона шины для 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 576B

11 maanden geleden
10 maanden geleden
11 maanden geleden
10 maanden geleden
11 maanden geleden
12345678910111213141516171819
  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. fmtMany = lines[2]
  8. fields = []
  9. for key in c.structure.model.fields:
  10. values = c.structure.model.fields[key]
  11. fmt = fieldFormat(fmtMany, fmtPlain, fmtRecent, key, c.structure)
  12. ln = fmt \
  13. .replace("%NAME%", key) \
  14. .replace("%TYPE%", values[0])
  15. fields.append(ln)
  16. c.contextFields = "\n".join(fields)