Skip to content

Commit f3c9a96

Browse files
committed
remove deprecated from flow and fix script after Copilot complains
1 parent 45930af commit f3c9a96

1,038 files changed

Lines changed: 966 additions & 951 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/extract_odm_strings.py

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/usr/bin/python3
22

3-
import argparse, os, urllib.request, ast, sys, glob
3+
import argparse
4+
import os
5+
import urllib.request
6+
import ast
7+
import sys
8+
import glob
49
from io import StringIO
510
from pathlib import Path
611
from string import Template
@@ -100,24 +105,33 @@ def ODM_ERROR(s):
100105
# Clean up the output directory - remove all existing .rst files
101106
print("Cleaning up %s ..." % argsoutdir)
102107
for old_file in glob.glob(os.path.join(argsoutdir, "*.rst")):
103-
os.remove(old_file)
108+
try:
109+
os.remove(old_file)
110+
print("Removed %s" % old_file)
111+
except (OSError, PermissionError) as e:
112+
print("Warning: Could not remove %s: %s" % (old_file, e))
104113

105114
# Clean up old .pot files for deprecated arguments
106115
if os.path.isdir(argspotdir):
107116
print("Cleaning up %s ..." % argspotdir)
108117
for old_pot in glob.glob(os.path.join(argspotdir, "*.pot")):
109-
os.remove(old_pot)
110-
print("Removed %s" % old_pot)
118+
try:
119+
os.remove(old_pot)
120+
print("Removed %s" % old_pot)
121+
except (OSError, PermissionError) as e:
122+
print("Warning: Could not remove %s: %s" % (old_pot, e))
111123

112124
# Clean up old .po files for deprecated arguments in all languages
113125
for lang in LANGUAGES:
114126
argspodir = os.path.join(localedir, lang, "LC_MESSAGES", "arguments")
115127
if os.path.isdir(argspodir):
116128
print("Cleaning up %s ..." % argspodir)
117129
for old_po in glob.glob(os.path.join(argspodir, "*.po")):
118-
os.remove(old_po)
119-
print("Removed %s" % old_po)
120-
print("Removed %s" % old_file)
130+
try:
131+
os.remove(old_po)
132+
print("Removed %s" % old_po)
133+
except (OSError, PermissionError) as e:
134+
print("Warning: Could not remove %s: %s" % (old_po, e))
121135

122136
with open(argstmplfile) as f:
123137
argstmpl = Template(f.read())
@@ -178,6 +192,20 @@ def get_opt_choices(opt):
178192

179193
print("Wrote %s" % outfile)
180194

195+
# Clean up orphaned files in arguments_edit/ directory
196+
arguments_edit_dir = os.path.join(argsoutdir + "_edit")
197+
if os.path.isdir(arguments_edit_dir):
198+
print("Cleaning up orphaned files in %s ..." % arguments_edit_dir)
199+
current_opt_names = set(get_opt_name(opt) for opt in keys)
200+
for edit_file in glob.glob(os.path.join(arguments_edit_dir, "*.rst")):
201+
edit_opt_name = os.path.splitext(os.path.basename(edit_file))[0]
202+
if edit_opt_name not in current_opt_names:
203+
try:
204+
os.remove(edit_file)
205+
print("Removed orphaned %s" % edit_file)
206+
except (OSError, PermissionError) as e:
207+
print("Warning: Could not remove %s: %s" % (edit_file, e))
208+
181209
# Update .tx/config to remove deprecated options
182210
if os.path.isfile(txconfigfile):
183211
print("Updating %s ..." % txconfigfile)

source/arguments_edit/debug.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/depthmap-resolution.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/pc-geometric.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/pc-tile.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/resize-to.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/texturing-data-term.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/texturing-outlier-removal-type.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/texturing-skip-local-seam-leveling.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

source/arguments_edit/texturing-tone-mapping.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)