[Bf-docboard-svn] bf-manual: [7815] trunk/blender_docs/tools_rst/rst_remap.py: RST Remap: Remove po file remapping

Aaron Carlisle noreply at blender.org
Wed Mar 10 20:45:21 CET 2021


Revision: 7815
          https://developer.blender.org/rBM7815
Author:   Blendify
Date:     2021-03-10 20:45:21 +0100 (Wed, 10 Mar 2021)
Log Message:
-----------
RST Remap: Remove po file remapping

This is not needed after T83212

Modified Paths:
--------------
    trunk/blender_docs/tools_rst/rst_remap.py

Modified: trunk/blender_docs/tools_rst/rst_remap.py
===================================================================
--- trunk/blender_docs/tools_rst/rst_remap.py	2021-03-10 18:49:24 UTC (rev 7814)
+++ trunk/blender_docs/tools_rst/rst_remap.py	2021-03-10 19:45:21 UTC (rev 7815)
@@ -67,7 +67,6 @@
 SUBDIR = ""
 CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
 RST_DIR = os.path.normpath(os.path.join(CURRENT_DIR, "..", "manual", SUBDIR))
-LOCALE_DIR = os.path.join(RST_DIR, "..", "locale")
 
 # name for temp file
 RST_MAP_ID = "rst_map.data"
@@ -208,53 +207,7 @@
             else:
                 print("warning: unknown path %r" % file_rstpath_src)
 
-    # now move PO files
-    if os.path.exists(LOCALE_DIR):
-        import subprocess
-        from subprocess import check_call, check_output
 
-        # first check we have working svn installed
-        try:
-            # don't log to stdout (annoying)
-            check_output(["svn", "help"])
-            has_svn = True
-        except BaseException as ex:
-            print(
-                "warning: command 'svn' not found in your PATH, error:" +
-                str(srr) +
-                " not updating translations!"
-            )
-            has_svn = False
-
-        if has_svn:
-            translation_paths = [
-                os.path.join(LOCALE_DIR, d, "LC_MESSAGES") for d in os.listdir(LOCALE_DIR)
-                if not d.startswith(".")
-            ]
-
-            for file_path_src, file_path_dst in src_dst_map.items():
-                if file_path_src != file_path_dst:
-                    file_path_src = file_path_src.lstrip("\\/")
-                    file_path_dst = file_path_dst.lstrip("\\/")
-                    for locale_dir in translation_paths:
-                        file_path_src_po = os.path.join(locale_dir, file_path_src) + ".po"
-                        if not os.path.exists(file_path_src_po):
-                            print("warning: PO file not found %r" % file_path_src_po)
-                        else:
-                            file_path_dst_po = os.path.join(locale_dir, file_path_dst) + ".po"
-                            if os.path.exists(file_path_dst_po):
-                                print("warning: PO file already exists %r" % file_path_dst_po)
-                            else:
-                                dir_path_dst_po = os.path.dirname(file_path_dst_po)
-                                # ensure the new directory exist
-                                os.makedirs(dir_path_dst_po, exist_ok=True)
-                                try:
-                                    check_call(["svn", "info", dir_path_dst_po], cwd=locale_dir)
-                                except subprocess.CalledProcessError:
-                                    check_call(["svn", "add", "--parents", dir_path_dst_po], cwd=locale_dir)
-                                check_call(["svn", "mv", file_path_src_po, file_path_dst_po], cwd=locale_dir)
-
-
 def remap_finish_image(base_path, remap_image_src, remap_image_dst):
     src_dst_map = _src_dst_map(remap_image_src, remap_image_dst)
 



More information about the Bf-docboard-svn mailing list