Проверка шаблона шины для iOS
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

generateFile.py 1.6KB

před 1 rokem
12345678910111213141516171819202122232425262728
  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"