Skip to content

Commit bf9f075

Browse files
Merge pull request #259 from sbonaime/publish
Remove deprecated options and flags from doc and translated files
2 parents 8e7ff6f + 53aa506 commit bf9f075

1,327 files changed

Lines changed: 59630 additions & 35186 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.

.tx/config

Lines changed: 0 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,6 @@ type = PO
7373
replace_edited_strings = false
7474
keep_translations = false
7575

76-
[o:americanredcross:p:opendronemap_docs:r:arguments_debug]
77-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/debug.po
78-
source_file = source/locale/pot/arguments/debug.pot
79-
source_lang = en
80-
type = PO
81-
replace_edited_strings = false
82-
keep_translations = false
83-
8476
[o:americanredcross:p:opendronemap_docs:r:arguments_dem-decimation]
8577
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/dem-decimation.po
8678
source_file = source/locale/pot/arguments/dem-decimation.pot
@@ -113,14 +105,6 @@ type = PO
113105
replace_edited_strings = false
114106
keep_translations = false
115107

116-
[o:americanredcross:p:opendronemap_docs:r:arguments_depthmap-resolution]
117-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/depthmap-resolution.po
118-
source_file = source/locale/pot/arguments/depthmap-resolution.pot
119-
source_lang = en
120-
type = PO
121-
replace_edited_strings = false
122-
keep_translations = false
123-
124108
[o:americanredcross:p:opendronemap_docs:r:arguments_dsm]
125109
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/dsm.po
126110
source_file = source/locale/pot/arguments/dsm.pot
@@ -217,14 +201,6 @@ type = PO
217201
replace_edited_strings = false
218202
keep_translations = false
219203

220-
[o:americanredcross:p:opendronemap_docs:r:arguments_matcher-distance]
221-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/matcher-distance.po
222-
source_file = source/locale/pot/arguments/matcher-distance.pot
223-
source_lang = en
224-
type = PO
225-
replace_edited_strings = false
226-
keep_translations = false
227-
228204
[o:americanredcross:p:opendronemap_docs:r:arguments_matcher-neighbors]
229205
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/matcher-neighbors.po
230206
source_file = source/locale/pot/arguments/matcher-neighbors.pot
@@ -377,14 +353,6 @@ type = PO
377353
replace_edited_strings = false
378354
keep_translations = false
379355

380-
[o:americanredcross:p:opendronemap_docs:r:arguments_pc-geometric]
381-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/pc-geometric.po
382-
source_file = source/locale/pot/arguments/pc-geometric.pot
383-
source_lang = en
384-
type = PO
385-
replace_edited_strings = false
386-
keep_translations = false
387-
388356
[o:americanredcross:p:opendronemap_docs:r:arguments_pc-las]
389357
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/pc-las.po
390358
source_file = source/locale/pot/arguments/pc-las.pot
@@ -417,14 +385,6 @@ type = PO
417385
replace_edited_strings = false
418386
keep_translations = false
419387

420-
[o:americanredcross:p:opendronemap_docs:r:arguments_pc-tile]
421-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/pc-tile.po
422-
source_file = source/locale/pot/arguments/pc-tile.pot
423-
source_lang = en
424-
type = PO
425-
replace_edited_strings = false
426-
keep_translations = false
427-
428388
[o:americanredcross:p:opendronemap_docs:r:arguments_primary-band]
429389
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/primary-band.po
430390
source_file = source/locale/pot/arguments/primary-band.pot
@@ -473,14 +433,6 @@ type = PO
473433
replace_edited_strings = false
474434
keep_translations = false
475435

476-
[o:americanredcross:p:opendronemap_docs:r:arguments_resize-to]
477-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/resize-to.po
478-
source_file = source/locale/pot/arguments/resize-to.pot
479-
source_lang = en
480-
type = PO
481-
replace_edited_strings = false
482-
keep_translations = false
483-
484436
[o:americanredcross:p:opendronemap_docs:r:arguments_skip-3dmodel]
485437
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/skip-3dmodel.po
486438
source_file = source/locale/pot/arguments/skip-3dmodel.pot
@@ -569,14 +521,6 @@ type = PO
569521
replace_edited_strings = false
570522
keep_translations = false
571523

572-
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-data-term]
573-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-data-term.po
574-
source_file = source/locale/pot/arguments/texturing-data-term.pot
575-
source_lang = en
576-
type = PO
577-
replace_edited_strings = false
578-
keep_translations = false
579-
580524
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-keep-unseen-faces]
581525
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-keep-unseen-faces.po
582526
source_file = source/locale/pot/arguments/texturing-keep-unseen-faces.pot
@@ -585,14 +529,6 @@ type = PO
585529
replace_edited_strings = false
586530
keep_translations = false
587531

588-
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-outlier-removal-type]
589-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-outlier-removal-type.po
590-
source_file = source/locale/pot/arguments/texturing-outlier-removal-type.pot
591-
source_lang = en
592-
type = PO
593-
replace_edited_strings = false
594-
keep_translations = false
595-
596532
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-skip-global-seam-leveling]
597533
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-skip-global-seam-leveling.po
598534
source_file = source/locale/pot/arguments/texturing-skip-global-seam-leveling.pot
@@ -601,22 +537,6 @@ type = PO
601537
replace_edited_strings = false
602538
keep_translations = false
603539

604-
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-skip-local-seam-leveling]
605-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-skip-local-seam-leveling.po
606-
source_file = source/locale/pot/arguments/texturing-skip-local-seam-leveling.pot
607-
source_lang = en
608-
type = PO
609-
replace_edited_strings = false
610-
keep_translations = false
611-
612-
[o:americanredcross:p:opendronemap_docs:r:arguments_texturing-tone-mapping]
613-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/texturing-tone-mapping.po
614-
source_file = source/locale/pot/arguments/texturing-tone-mapping.pot
615-
source_lang = en
616-
type = PO
617-
replace_edited_strings = false
618-
keep_translations = false
619-
620540
[o:americanredcross:p:opendronemap_docs:r:arguments_tiles]
621541
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/tiles.po
622542
source_file = source/locale/pot/arguments/tiles.pot
@@ -625,14 +545,6 @@ type = PO
625545
replace_edited_strings = false
626546
keep_translations = false
627547

628-
[o:americanredcross:p:opendronemap_docs:r:arguments_time]
629-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/time.po
630-
source_file = source/locale/pot/arguments/time.pot
631-
source_lang = en
632-
type = PO
633-
replace_edited_strings = false
634-
keep_translations = false
635-
636548
[o:americanredcross:p:opendronemap_docs:r:arguments_use-3dmesh]
637549
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/use-3dmesh.po
638550
source_file = source/locale/pot/arguments/use-3dmesh.pot
@@ -665,14 +577,6 @@ type = PO
665577
replace_edited_strings = false
666578
keep_translations = false
667579

668-
[o:americanredcross:p:opendronemap_docs:r:arguments_verbose]
669-
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/verbose.po
670-
source_file = source/locale/pot/arguments/verbose.pot
671-
source_lang = en
672-
type = PO
673-
replace_edited_strings = false
674-
keep_translations = false
675-
676580
[o:americanredcross:p:opendronemap_docs:r:arguments_version]
677581
file_filter = source/locale/<lang>/LC_MESSAGES/arguments/version.po
678582
source_file = source/locale/pot/arguments/version.pot

Makefile

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ help:
1515
.PHONY: help Makefile
1616

1717
# this is for testing, it will only build the EN version of the docs
18-
livehtml:
18+
livehtml: autogenerate
1919
sphinx-autobuild --open-browser --host 0.0.0.0 -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/html"
2020

2121
# this will update `arguments.rst` to match arguments in the ODM code
@@ -24,22 +24,38 @@ livehtml:
2424
# all user contributed content from files in `source/arguments_edit/`
2525
autogenerate:
2626
python scripts/extract_odm_strings.py https://raw.githubusercontent.com/OpenDroneMap/ODM/master/opendm/config.py
27+
@$(SPHINXBUILD) -b gettext "$(SOURCEDIR)" "source/locale/pot"
28+
sphinx-intl update --pot-dir "source/locale/pot" --language ar,cs,es,fil,fr,id,sw,te,zh
29+
@$(MAKE) cleanobsolete
2730

2831
# update main EN pot files that serve as the source for translation process
2932
updatepot:
3033
@$(SPHINXBUILD) -b gettext "$(SOURCEDIR)" "source/locale/pot"
3134

3235
# update the po files for each target language from the EN pot files
3336
updatelangpo:
34-
sphinx-intl update --pot-dir "source/locale/pot" --language cs,es,fil,fr,id,sw,te,zh
37+
sphinx-intl update --pot-dir "source/locale/pot" --language ar,cs,es,fil,fr,id,sw,te,zh
38+
@$(MAKE) cleanobsolete
39+
40+
# remove obsolete entries from all .po files
41+
cleanobsolete:
42+
@echo "Removing obsolete entries from .po files..."
43+
@for lang in ar cs es fil fr id sw te zh; do \
44+
for po in source/locale/$$lang/LC_MESSAGES/*.po source/locale/$$lang/LC_MESSAGES/*/*.po; do \
45+
if [ -f "$$po" ]; then \
46+
msgattrib --no-obsolete --no-fuzzy -o "$$po.tmp" "$$po" 2>/dev/null && mv "$$po.tmp" "$$po" || rm -f "$$po.tmp"; \
47+
fi; \
48+
done; \
49+
done
50+
@echo "Done cleaning obsolete entries."
3551

3652
# push new and changed strings to Transifex
3753
pushlang:
3854
tx push --source
3955

4056
# push translated strings from Transifex
4157
pulllang:
42-
tx pull --language "cs,es,fil,fr,id,sw,te,zh"
58+
tx pull --language "ar,cs,es,fil,fr,id,sw,te,zh"
4359

4460
build:
4561
@$(SPHINXBUILD) -b dirhtml "$(SOURCEDIR)" "$(BUILDDIR)/html" -nW

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ From the same Terminal (or command prompt) run the following:
8888

8989
```
9090
cd docs/
91-
python3 -m venv .venv
92-
source .venv/bin/activate
91+
python3.12 -m venv .venv
9392
9493
# Linux/Mac
9594
source .venv/bin/activate

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ sphinx-intl==2.0.1
44
sphinx-rtd-theme==1.1.1
55
transifex-client==0.12.5
66
sphinxcontrib-mermaid==0.9.2
7+
sphinx-copybutton==0.3.1

requirements_prod.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ sphinx==7.4.7
33
sphinx-intl
44
sphinx-rtd-theme
55
sphinxcontrib-mermaid
6+
sphinx-copybutton
67
wheel

scripts/extract_odm_strings.py

Lines changed: 100 additions & 1 deletion
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
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
@@ -16,6 +21,12 @@
1621
tmplfile = os.path.join(os.path.dirname(__file__), "arguments.template.rst")
1722
argstmplfile = os.path.join(os.path.dirname(__file__), "arguments.arg.template.rst")
1823
argsoutdir = os.path.join(os.path.dirname(__file__), "..", "source", "arguments")
24+
argspotdir = os.path.join(os.path.dirname(__file__), "..", "source", "locale", "pot", "arguments")
25+
localedir = os.path.join(os.path.dirname(__file__), "..", "source", "locale")
26+
txconfigfile = os.path.join(os.path.dirname(__file__), "..", ".tx", "config")
27+
28+
# List of supported languages (should match Makefile)
29+
LANGUAGES = ['ar', 'cs', 'es', 'fil', 'fr', 'id', 'sw', 'te', 'zh']
1930

2031
strings = []
2132
print("Fetching %s ..." % url)
@@ -91,6 +102,37 @@ def ODM_ERROR(s):
91102
keys = list(options.keys())
92103
keys.sort(key=lambda a: a.replace("-", ""))
93104

105+
# Clean up the output directory - remove all existing .rst files
106+
print("Cleaning up %s ..." % argsoutdir)
107+
for old_file in glob.glob(os.path.join(argsoutdir, "*.rst")):
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))
113+
114+
# Clean up old .pot files for deprecated arguments
115+
if os.path.isdir(argspotdir):
116+
print("Cleaning up %s ..." % argspotdir)
117+
for old_pot in glob.glob(os.path.join(argspotdir, "*.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))
123+
124+
# Clean up old .po files for deprecated arguments in all languages
125+
for lang in LANGUAGES:
126+
argspodir = os.path.join(localedir, lang, "LC_MESSAGES", "arguments")
127+
if os.path.isdir(argspodir):
128+
print("Cleaning up %s ..." % argspodir)
129+
for old_po in glob.glob(os.path.join(argspodir, "*.po")):
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))
135+
94136
with open(argstmplfile) as f:
95137
argstmpl = Template(f.read())
96138

@@ -150,6 +192,63 @@ def get_opt_choices(opt):
150192

151193
print("Wrote %s" % outfile)
152194

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+
209+
# Update .tx/config to remove deprecated options
210+
if os.path.isfile(txconfigfile):
211+
print("Updating %s ..." % txconfigfile)
212+
with open(txconfigfile, 'r') as f:
213+
config_lines = f.readlines()
214+
215+
# Get list of current options
216+
current_opts = set(get_opt_name(opt) for opt in keys)
217+
218+
# Parse and filter .tx/config
219+
new_config_lines = []
220+
skip_section = False
221+
i = 0
222+
while i < len(config_lines):
223+
line = config_lines[i]
224+
225+
# Check if this is an arguments section header
226+
if line.startswith('[o:americanredcross:p:opendronemap_docs:r:arguments_'):
227+
# Extract option name
228+
section_name = line.strip()[1:-1] # Remove [ and ]
229+
opt_name = section_name.split(':')[-1].replace('arguments_', '')
230+
231+
# Check if this option still exists
232+
if opt_name not in current_opts:
233+
print("Removing deprecated section: %s" % opt_name)
234+
skip_section = True
235+
# Skip this section header and all lines until next section or EOF
236+
i += 1
237+
while i < len(config_lines) and not config_lines[i].startswith('['):
238+
i += 1
239+
continue
240+
else:
241+
skip_section = False
242+
243+
if not skip_section:
244+
new_config_lines.append(line)
245+
246+
i += 1
247+
248+
# Write updated config
249+
with open(txconfigfile, 'w') as f:
250+
f.writelines(new_config_lines)
251+
print("Updated %s" % txconfigfile)
153252

154253
else:
155254
print("No strings found")

source/arguments/debug.rst

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)