poxy 0.19.4__py3-none-any.whl → 0.19.5__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/run.py CHANGED
@@ -13,6 +13,7 @@ import subprocess
13
13
  import tempfile
14
14
  import copy
15
15
  import sys
16
+ import platform
16
17
 
17
18
  from io import StringIO
18
19
  from lxml import etree
@@ -611,6 +612,25 @@ def postprocess_xml(context: Context):
611
612
  highlight.getparent().remove(highlight)
612
613
  changed = True
613
614
  continue
615
+ # fix <programlisting> losing the file type if we've set it explicitly
616
+ if (
617
+ not programlisting.get(r'filename')
618
+ and len(programlisting) >= 2
619
+ and programlisting[0].tag == 'codeline'
620
+ ):
621
+ codeline = programlisting[0]
622
+ if len(codeline) == 1 and codeline[0].tag == 'highlight':
623
+ highlight = codeline[0]
624
+ if len(highlight) <= 1 and highlight.text:
625
+ m = re.fullmatch(r"[{]([.][a-zA-Z0-9_-]+)[}]", highlight.text)
626
+ if m:
627
+ programlisting.set('filename', m[1])
628
+ programlisting.remove(codeline)
629
+ changed = True
630
+ # map .ascii -> .shell-session
631
+ if programlisting.get(r'filename') == '.ascii':
632
+ programlisting.set('filename', '.shell-session')
633
+ changed = True
614
634
 
615
635
  # add entry to compounds etc
616
636
  if compound_id not in context.compounds:
@@ -1721,13 +1741,48 @@ def run_mcss(context: Context):
1721
1741
  if context.is_verbose():
1722
1742
  doxy_args.append(r'--debug')
1723
1743
  try:
1744
+
1745
+ env = {k: v for k, v in os.environ.items()}
1746
+
1747
+ if 'LIBGS' not in env and platform.system().lower() == 'linux':
1748
+ libgs_set = False
1749
+
1750
+ def try_set_libgs(p: Path) -> bool:
1751
+ nonlocal libgs_set
1752
+ nonlocal env
1753
+ if libgs_set:
1754
+ return True
1755
+ p = coerce_path(p)
1756
+ if not p:
1757
+ return False
1758
+ p = p.resolve()
1759
+ if not p.is_file():
1760
+ return False
1761
+ env['LIBGS'] = str(p)
1762
+ libgs_set = True
1763
+ return True
1764
+
1765
+ machine = platform.machine()
1766
+ if machine:
1767
+ for prefix in ('/local/', '/'):
1768
+ for i in range(20, 9, -1):
1769
+ for j in range(20, -1, -1):
1770
+ if try_set_libgs(rf"/usr{prefix}lib/{machine}-linux-gnu/libgs.so.{i}.{j:02}"):
1771
+ break
1772
+ if libgs_set or try_set_libgs(rf"/usr{prefix}lib/{machine}-linux-gnu/libgs.so.{i}"):
1773
+ break
1774
+ if libgs_set:
1775
+ break
1776
+
1724
1777
  run_python_script(
1725
1778
  Path(paths.MCSS, r'documentation/doxygen.py'),
1726
1779
  *doxy_args,
1727
1780
  stdout=stdout,
1728
1781
  stderr=stderr,
1729
1782
  cwd=context.input_dir,
1783
+ env=env,
1730
1784
  )
1785
+
1731
1786
  except:
1732
1787
  context.info(r'm.css failed!')
1733
1788
  dump_output_streams(context, read_output_streams(stdout, stderr), source=r'm.css')
poxy/version.txt CHANGED
@@ -1 +1 @@
1
- 0.19.4
1
+ 0.19.5