nwztools: Update database generator script to work with python3

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]> Fri, 29 May 2026 23:38:07 -0400
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit d72a93836cc63272098d56da4fbc33c1924437d1
Author: Solomon Peachy <[email protected]>
Date:   Fri May 29 23:34:53 2026 -0400

    nwztools:  Update database generator script to work with python3
    
    Change-Id: I662de90b57a3836755b88ff51537eb1597f226f4

diff --git a/.gitignore b/.gitignore
index 581cfbaa98..46953989eb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -193,6 +193,7 @@ __pycache__
 # /utils/nwztools
 /utils/nwztools/scsitools/scsitool
 /utils/nwztools/upgtools/upgtool
+/utils/nwztools/emmctools/emmctool
 
 #  utils/rk27utils 
 /utils/rk27utils/rkboottool/rkboottool
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
index 9e8bc89102..c7cb1dcb98 100755
--- a/utils/nwztools/database/gen_db.py
+++ b/utils/nwztools/database/gen_db.py
@@ -51,7 +51,7 @@ for f in map_files:
     h = hashlib.md5()
     h.update(open(f, "rb").read())
     hash = h.hexdigest()
-    codename = re.search('nvp/([^\.]*)\.txt', f).group(1)
+    codename = re.search('nvp/([^\\.]*)\\.txt', f).group(1)
     # sanity check
     if not (codename in g_series_codename):
         print("Warning: file %s does not have a match series in series.txt" % f)
@@ -133,11 +133,11 @@ header_begin = \
 """\
 /***************************************************************************
  *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \\
- *                     \/            \/     \/    \/            \/
+ *   Open      \\______   \\ ____   ____ |  | _\\_ |__   _______  ___
+ *   Source     |       _//  _ \\_/ ___\\|  |/ /| __ \\ /  _ \\  \\/  /
+ *   Jukebox    |    |   (  <_> )  \\___|    < | \\_\\ (  <_> > <  <
+ *   Firmware   |____|_  /\\____/ \\___  >__|_ \\|___  /\\____/__/\\_ \\
+ *                     \\/            \\/     \\/    \\/            \\/
  *
  * Copyright (C) 2016 Amaury Pouly
  *
@@ -153,7 +153,7 @@ header_begin = \
 #ifndef __NWZ_DB_H__
 #define __NWZ_DB_H__
 
-/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
+/** /!\\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\\ */
 
 /* List of all known NVP nodes */
 enum nwz_nvp_node_t
@@ -232,11 +232,11 @@ impl_begin = \
 """\
 /***************************************************************************
  *             __________               __   ___.
- *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
- *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
- *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
- *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \\
- *                     \/            \/     \/    \/            \/
+ *   Open      \\______   \\ ____   ____ |  | _\\_ |__   _______  ___
+ *   Source     |       _//  _ \\_/ ___\\|  |/ /| __ \\ /  _ \\  \\/  /
+ *   Jukebox    |    |   (  <_> )  \\___|    < | \\_\\ (  <_> > <  <
+ *   Firmware   |____|_  /\\____/ \\___  >__|_ \\|___  /\\____/__/\\_ \\
+ *                     \\/            \\/     \\/    \\/            \\/
  *
  * Copyright (C) 2016 Amaury Pouly
  *
@@ -250,7 +250,7 @@ impl_begin = \
  *
  ****************************************************************************/
 
-/** /!\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\ */
+/** /!\\ This file was automatically generated, DO NOT MODIFY IT DIRECTLY /!\\ */
 
 #include "nwz-db.h"
 
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs