Skip to content
Snippets Groups Projects
  1. Sep 09, 2022
  2. Aug 01, 2022
  3. Jul 06, 2022
  4. Jun 27, 2022
  5. Jun 14, 2022
  6. Jun 13, 2022
  7. May 19, 2022
  8. Feb 21, 2022
  9. Feb 08, 2022
  10. Feb 01, 2022
  11. Jan 27, 2022
  12. Jan 21, 2022
  13. Jan 16, 2022
  14. Jan 07, 2022
  15. Dec 28, 2021
  16. Dec 10, 2021
  17. Nov 22, 2021
  18. Nov 05, 2021
  19. Nov 02, 2021
  20. Nov 01, 2021
  21. Sep 20, 2021
    • Wuttke, Joachim's avatar
      Initialize item and item parameter tags in header files. · 2a33f913
      Wuttke, Joachim authored
      import edtools as et
      import re
      
      def user_edit_pair(fname_stem, th, tc):
      
          data = []
          mm = re.finditer('const QString (\w+)::([MPT]_[A-Z0-9_]+) = "(.+?)";', tc)
          for m in mm:
              data.append([m.group(1), m.group(2), m.group(3)])
          mm = re.finditer('const QString (\w+)::([MPT]_[A-Z0-9_]+)\("(.+?)"\);', tc)
          for m in mm:
              data.append([m.group(1), m.group(2), m.group(3)])
      
          for cname, typ, label in data:
              rlabel = re.sub(r'\[', r'\\[', label)
              rlabel = re.sub(r'\]', r'\\]', rlabel)
              rlabel = re.sub(r'\(', r'\\(', rlabel)
              rlabel = re.sub(r'\)', r'\\)', rlabel)
              tc = re.sub('\n+const QString '+cname+'::'+typ+' =\s+"'+rlabel+'";', '', tc)
              tc = re.sub('\n+const QString '+cname+'::'+typ+'\("'+rlabel+'"\);', '', tc)
              th = re.sub(r'class( BA_CORE_API_)? ('+cname+r'.+?)static const QString '+typ+r';(.*?\n};)',
                          r'class \2static constexpr auto '+typ+r'{"'+label+r'"};\3', th, 0, re.S)
      
          return th, tc
      
      et.ed_argfilepairs(user_edit_pair)
      2a33f913
  22. Jun 07, 2021
  23. May 11, 2021
  24. May 10, 2021
Loading