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

generateFile.py 1.6KB

10 months ago
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"