Проверка шаблона шины для iOS
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

29 rindas
1.6KB

  1. def generateFile(c):
  2. fileName = f"{c.dir}/templates/file"
  3. fmt = c.readFile(fileName)
  4. for ln in fmt:
  5. newLine = ln \
  6. .replace("%CONTEXT_FIELDS%", c.contextFields) \
  7. .replace("%CORE%", c.core) \
  8. .replace("%CORE_SECTION_GENERATED%", c.coreSectionGenerated) \
  9. .replace("%CORE_SECTION_GENERATED_ACTIONS%", c.coreSectionGeneratedActions) \
  10. .replace("%CORE_SECTION_GENERATED_PIPES%", c.coreSectionGeneratedPipes) \
  11. .replace("%CORE_SECTIONS_DESTROY%", c.coreSectionsDestroy) \
  12. .replace("%CORE_SECTIONS_SETUP%", c.coreSectionsSetup) \
  13. .replace("%CORE_VM%", c.coreVM) \
  14. .replace("%CORE_WINDOW%", c.coreWindow) \
  15. .replace("%IMPORTS%", c.imports) \
  16. .replace("%MODEL_FIELDS%", c.modelFields) \
  17. .replace("%SERVICE_CORE%", c.serviceCore) \
  18. .replace("%SERVICE_SECTION_GENERATED%", c.serviceSectionGenerated) \
  19. .replace("%SERVICE_SECTION_GENERATED_ACTIONS%", c.serviceSectionGeneratedActions) \
  20. .replace("%SERVICE_SECTION_GENERATED_PIPES%", c.serviceSectionGeneratedPipes) \
  21. .replace("%SERVICE_SECTIONS%", c.serviceSections) \
  22. .replace("%WORLD_CONSTRUCTOR%", c.worldConstructor) \
  23. .replace("%WORLD_FIELDS%", c.worldFields) \
  24. .replace("%WORLD_PARAMETERS%", c.worldParameters) \
  25. .replace("%MODULE%", c.module) \
  26. .replace("%MODULE_SHORT%", c.shortenName(c.module)) # Замены %MODULE*% должны быть в конце.
  27. c.file += newLine + "\n"