poxy 0.18.0__py3-none-any.whl → 0.19.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- poxy/generated/poxy.css +2 -1
- poxy/main.py +9 -2
- poxy/mcss/CONTRIBUTING.rst +1 -1
- poxy/mcss/CREDITS.rst +2 -0
- poxy/mcss/css/m-components.css +1 -1
- poxy/mcss/css/m-debug.css +1 -1
- poxy/mcss/css/m-documentation.css +1 -1
- poxy/mcss/css/m-grid.css +1 -1
- poxy/mcss/css/m-layout.css +1 -1
- poxy/mcss/documentation/__init__.py +1 -1
- poxy/mcss/documentation/_search.py +1 -1
- poxy/mcss/documentation/doxygen.py +202 -25
- poxy/mcss/documentation/python.py +66 -22
- poxy/mcss/documentation/search.js +1 -1
- poxy/mcss/plugins/ansilexer.py +1 -1
- poxy/mcss/plugins/dot2svg.py +1 -1
- poxy/mcss/plugins/latex2svgextra.py +1 -1
- poxy/mcss/plugins/m/__init__.py +1 -1
- poxy/mcss/plugins/m/abbr.py +1 -1
- poxy/mcss/plugins/m/alias.py +1 -1
- poxy/mcss/plugins/m/code.py +4 -5
- poxy/mcss/plugins/m/components.py +1 -1
- poxy/mcss/plugins/m/dot.py +1 -1
- poxy/mcss/plugins/m/dox.py +1 -1
- poxy/mcss/plugins/m/filesize.py +1 -1
- poxy/mcss/plugins/m/gh.py +1 -1
- poxy/mcss/plugins/m/gl.py +1 -1
- poxy/mcss/plugins/m/htmlsanity.py +14 -6
- poxy/mcss/plugins/m/images.py +1 -1
- poxy/mcss/plugins/m/link.py +1 -1
- poxy/mcss/plugins/m/math.py +1 -1
- poxy/mcss/plugins/m/metadata.py +1 -1
- poxy/mcss/plugins/m/plots.py +1 -1
- poxy/mcss/plugins/m/qr.py +1 -1
- poxy/mcss/plugins/m/sphinx.py +1 -1
- poxy/mcss/plugins/m/vk.py +1 -1
- poxy/project.py +25 -5
- poxy/run.py +103 -17
- poxy/version.txt +1 -1
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/METADATA +182 -170
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/RECORD +46 -46
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/WHEEL +1 -1
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/LICENSE.txt +0 -0
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/entry_points.txt +0 -0
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/top_level.txt +0 -0
- {poxy-0.18.0.dist-info → poxy-0.19.1.dist-info}/zip-safe +0 -0
poxy/run.py
CHANGED
@@ -11,9 +11,10 @@ import concurrent.futures as futures
|
|
11
11
|
import os
|
12
12
|
import subprocess
|
13
13
|
import tempfile
|
14
|
-
|
15
|
-
|
14
|
+
import copy
|
15
|
+
import sys
|
16
16
|
|
17
|
+
from io import StringIO
|
17
18
|
from lxml import etree
|
18
19
|
from trieregex import TrieRegEx
|
19
20
|
|
@@ -23,6 +24,19 @@ from .svg import SVG
|
|
23
24
|
from .utils import *
|
24
25
|
from .version import *
|
25
26
|
|
27
|
+
if sys.version_info >= (3, 8):
|
28
|
+
import shutil
|
29
|
+
|
30
|
+
def copy_tree(src, dest):
|
31
|
+
shutil.copytree(str(src), str(dest), dirs_exist_ok=True)
|
32
|
+
|
33
|
+
else:
|
34
|
+
import distutils.dir_util
|
35
|
+
|
36
|
+
def copy_tree(src, dest):
|
37
|
+
distutils.dir_util.copy_tree(str(src), str(dest))
|
38
|
+
|
39
|
+
|
26
40
|
# =======================================================================================================================
|
27
41
|
# HELPERS
|
28
42
|
# =======================================================================================================================
|
@@ -466,6 +480,78 @@ def postprocess_xml(context: Context):
|
|
466
480
|
if changed:
|
467
481
|
xml_utils.write(root, xml_file)
|
468
482
|
|
483
|
+
# doxygen >= 1.9.7 needs some special handling to play nice with m.css
|
484
|
+
# see: https://github.com/mosra/m.css/issues/239
|
485
|
+
if doxygen.version() >= (1, 9, 7):
|
486
|
+
|
487
|
+
member_references = dict()
|
488
|
+
|
489
|
+
# collect all the unresolved references
|
490
|
+
for xml_file in xml_files:
|
491
|
+
root = xml_utils.read(xml_file)
|
492
|
+
if root.tag != r'doxygen':
|
493
|
+
continue
|
494
|
+
compounddef = root.find(r'compounddef')
|
495
|
+
if compounddef is None:
|
496
|
+
continue
|
497
|
+
compound_kind = compounddef.get(r'kind')
|
498
|
+
if compound_kind is None or not compound_kind or not compound_kind in (r'file', r'namespace'):
|
499
|
+
continue
|
500
|
+
for sectiondef in compounddef.findall(r'sectiondef'):
|
501
|
+
for member in sectiondef.findall(r'member'):
|
502
|
+
refid = member.get(r'refid')
|
503
|
+
if refid is not None:
|
504
|
+
refid = str(refid)
|
505
|
+
if refid and refid not in member_references:
|
506
|
+
member_references[refid] = None
|
507
|
+
|
508
|
+
if member_references:
|
509
|
+
|
510
|
+
# resolve
|
511
|
+
for xml_file in xml_files:
|
512
|
+
root = xml_utils.read(xml_file)
|
513
|
+
if root.tag != r'doxygen':
|
514
|
+
continue
|
515
|
+
compounddef = root.find(r'compounddef')
|
516
|
+
if compounddef is None:
|
517
|
+
continue
|
518
|
+
for sectiondef in compounddef.findall(r'sectiondef'):
|
519
|
+
for memberdef in sectiondef.findall(r'memberdef'):
|
520
|
+
id = memberdef.get(r'id')
|
521
|
+
if id is not None:
|
522
|
+
id = str(id)
|
523
|
+
if id and id in member_references and member_references[id] is None:
|
524
|
+
member_references[id] = memberdef
|
525
|
+
for id, memberdef in member_references.items():
|
526
|
+
if memberdef is None:
|
527
|
+
context.warning(rf"could not resolve <member> reference with id '{id}'!")
|
528
|
+
|
529
|
+
# replace
|
530
|
+
for xml_file in xml_files:
|
531
|
+
root = xml_utils.read(xml_file)
|
532
|
+
if root.tag != r'doxygen':
|
533
|
+
continue
|
534
|
+
compounddef = root.find(r'compounddef')
|
535
|
+
if compounddef is None:
|
536
|
+
continue
|
537
|
+
compound_kind = compounddef.get(r'kind')
|
538
|
+
if compound_kind is None or not compound_kind or not compound_kind in (r'file', r'namespace'):
|
539
|
+
continue
|
540
|
+
changed = False
|
541
|
+
for sectiondef in compounddef.findall(r'sectiondef'):
|
542
|
+
replacements = []
|
543
|
+
for member in sectiondef.findall(r'member'):
|
544
|
+
refid = member.get(r'refid')
|
545
|
+
if refid is not None:
|
546
|
+
refid = str(refid)
|
547
|
+
if refid and refid in member_references and member_references[refid] is not None:
|
548
|
+
replacements.append((member, member_references[refid]))
|
549
|
+
for member, memberdef in replacements:
|
550
|
+
sectiondef.replace(member, copy.deepcopy(memberdef))
|
551
|
+
changed = True
|
552
|
+
if changed:
|
553
|
+
xml_utils.write(root, xml_file)
|
554
|
+
|
469
555
|
# now do '<doxygen>' files
|
470
556
|
for xml_file in xml_files:
|
471
557
|
root = xml_utils.read(xml_file)
|
@@ -503,15 +589,6 @@ def postprocess_xml(context: Context):
|
|
503
589
|
compound_title = compounddef.find(r'title')
|
504
590
|
compound_title = compound_title.text if compound_title is not None else compound_name
|
505
591
|
|
506
|
-
# fix weird regression in doxygen 1.9.7
|
507
|
-
if compound_kind == r'file' and doxygen.version() == (1, 9, 7):
|
508
|
-
sectiondefs = [s for s in compounddef.findall(r'sectiondef') if s.get(r'kind') == r'define']
|
509
|
-
for sectiondef in sectiondefs:
|
510
|
-
members = [m for m in sectiondef.findall(r'member') if m.get(r'kind') == r'define']
|
511
|
-
for member in members:
|
512
|
-
sectiondef.remove(member)
|
513
|
-
changed = True
|
514
|
-
|
515
592
|
# do a bit of cleanup of <programlisting>
|
516
593
|
for programlisting in compounddef.iterdescendants(tag="programlisting"):
|
517
594
|
# fix &zwj; mangling (zero-width joiners don't make sense in code blocks anyways)
|
@@ -630,8 +707,10 @@ def postprocess_xml(context: Context):
|
|
630
707
|
changed = True
|
631
708
|
if attr is not None:
|
632
709
|
member.set(attr, attr_value)
|
633
|
-
|
634
|
-
|
710
|
+
if kw == r'friend' and type.text == r'' and member.get(r'kind') == r'variable':
|
711
|
+
type.text = r'friend'
|
712
|
+
matched_bad_keyword = False
|
713
|
+
break
|
635
714
|
|
636
715
|
# fix issues with trailing return types
|
637
716
|
if 1:
|
@@ -1108,11 +1187,13 @@ def parse_xml(context: Context):
|
|
1108
1187
|
context.verbose_object(r'Context.code_blocks', context.code_blocks)
|
1109
1188
|
|
1110
1189
|
|
1111
|
-
def clean_xml(context: Context):
|
1190
|
+
def clean_xml(context: Context, dir=None):
|
1112
1191
|
assert context is not None
|
1113
1192
|
assert isinstance(context, Context)
|
1193
|
+
if dir is None:
|
1194
|
+
dir = context.temp_xml_dir
|
1114
1195
|
|
1115
|
-
xml_files = get_all_files(
|
1196
|
+
xml_files = get_all_files(dir, any=(r'*.xml'))
|
1116
1197
|
for xml_file in xml_files:
|
1117
1198
|
root = xml_utils.read(
|
1118
1199
|
xml_file, parser=xml_utils.create_parser(remove_blank_text=True), logger=context.verbose_logger #
|
@@ -1674,6 +1755,7 @@ def run(
|
|
1674
1755
|
temp_dir: Path = None,
|
1675
1756
|
copy_config_to: Path = None,
|
1676
1757
|
versions_in_navbar: bool = False,
|
1758
|
+
keep_original_xml: bool = False,
|
1677
1759
|
**kwargs,
|
1678
1760
|
):
|
1679
1761
|
timer = lambda desc: ScopeTimer(desc, print_start=True, print_end=context.verbose_logger)
|
@@ -1707,7 +1789,11 @@ def run(
|
|
1707
1789
|
# generate + postprocess XML in temp_xml_dir
|
1708
1790
|
# (we always do this even when output_xml is false because it is required by the html)
|
1709
1791
|
with timer(rf'Generating XML files with Doxygen {doxygen.version_string()}') as t:
|
1792
|
+
delete_directory(context.temp_original_xml_dir)
|
1710
1793
|
run_doxygen(context)
|
1794
|
+
if keep_original_xml:
|
1795
|
+
copy_tree(context.temp_xml_dir, context.temp_original_xml_dir)
|
1796
|
+
clean_xml(context, dir=context.temp_original_xml_dir)
|
1711
1797
|
with timer(r'Post-processing XML files') as t:
|
1712
1798
|
if context.xml_v2:
|
1713
1799
|
postprocess_xml_v2(context)
|
@@ -1722,7 +1808,7 @@ def run(
|
|
1722
1808
|
# XML (the user-requested copy)
|
1723
1809
|
if context.output_xml:
|
1724
1810
|
with ScopeTimer(r'Copying XML', print_start=True, print_end=context.verbose_logger) as t:
|
1725
|
-
copy_tree(
|
1811
|
+
copy_tree(context.temp_xml_dir, context.xml_dir)
|
1726
1812
|
|
1727
1813
|
# copy tagfile
|
1728
1814
|
if context.generate_tagfile and context.tagfile_path:
|
@@ -1745,7 +1831,7 @@ def run(
|
|
1745
1831
|
# copy fonts
|
1746
1832
|
if context.copy_assets:
|
1747
1833
|
with ScopeTimer(r'Copying fonts', print_start=True, print_end=context.verbose_logger) as t:
|
1748
|
-
copy_tree(
|
1834
|
+
copy_tree(paths.FONTS, Path(context.assets_dir, r'fonts'))
|
1749
1835
|
|
1750
1836
|
# copy tagfile
|
1751
1837
|
if context.generate_tagfile and context.tagfile_path:
|
poxy/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.19.1
|