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

generateServiceSections.py 879B

преди 11 месеца
123456789101112131415161718192021222324252627
  1. from generation.hasSectionGenerated import *
  2. from generation.sectionFunctions import *
  3. from generation.sectionNames import *
  4. def generateServiceSections(c):
  5. fileName = f"{c.dir}/templates/service-section"
  6. lines = c.readFile(fileName)
  7. fmtService = lines[0]
  8. fmtPlatform = lines[1]
  9. items = []
  10. sections = sectionNames(c)
  11. for name in sections:
  12. # Пропускаем секции, не относящиеся к сервису.
  13. funcs = sectionFunctions(name, c)
  14. if "setupService" not in funcs:
  15. continue
  16. ln = fmtService.replace("%NAME%", name)
  17. items.append(ln)
  18. # Генерированная секция.
  19. # Должна быть добавлена последней.
  20. if hasSectionGenerated(c.structure.service):
  21. items.append(fmtPlatform)
  22. c.serviceSections= "\n".join(items)