Проверка шаблона шины для iOS
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

19 行
544B

  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)