validators.py 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. def is_valid_section(section_class_name, text):
  2. return IS_VALID_SECTION.get(section_class_name, unvalid_section)(text)
  3. def is_valid_section3_section(text):
  4. return 'class="section3"' in text
  5. def is_valid_section3_text_center_section(text):
  6. return 'class="section3 text-center"' in text
  7. def is_valid_section13_overly_section(text):
  8. return 'class="section13 overly"' in text
  9. def is_valid_section14_section(text):
  10. return 'class="section14"' in text
  11. def is_valid_section14_d_flex_section(text):
  12. return 'class="section14 d-flex align-items-center"' in text
  13. def is_valid_section13_section(text):
  14. return 'class="section13"' in text
  15. def is_valid_section16_section(text):
  16. return 'class="section16"' in text
  17. def is_valid_section17_section(text):
  18. return 'class="section17"' in text
  19. def is_valid_section18_section(text):
  20. return 'class="section18"' in text
  21. def is_valid_section19_section(text):
  22. return 'class="section19"' in text
  23. def is_valid_section22_section(text):
  24. return 'class="section22"' in text
  25. def is_valid_section25_section(text):
  26. return 'class="section25"' in text
  27. def is_valid_section26_section(text):
  28. return 'class="section26"' in text
  29. def is_valid_section27_section(text):
  30. return 'class="section27"' in text
  31. def is_valid_section28_section(text):
  32. return 'class="section28"' in text
  33. def is_valid_section29_section(text):
  34. return 'class="section29"' in text
  35. def unvalid_section(text):
  36. return None
  37. IS_VALID_SECTION = {'section3': is_valid_section3_section,
  38. 'section3_text-center': is_valid_section3_text_center_section,
  39. 'section13_overly': is_valid_section13_overly_section,
  40. 'section13': is_valid_section13_section,
  41. 'section14': is_valid_section14_section,
  42. 'section14_d-flex_align-items-center': is_valid_section14_d_flex_section,
  43. 'section16': is_valid_section16_section,
  44. 'section17': is_valid_section17_section,
  45. 'section18': is_valid_section18_section,
  46. 'section19': is_valid_section19_section,
  47. 'section22': is_valid_section22_section,
  48. 'section25': is_valid_section25_section,
  49. 'section26': is_valid_section26_section,
  50. 'section27': is_valid_section27_section,
  51. 'section28': is_valid_section28_section,
  52. 'section29': is_valid_section29_section}