rda-python-miscs 2.0.6__tar.gz → 2.0.7__tar.gz
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.
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/PKG-INFO +1 -1
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/pyproject.toml +1 -1
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/pg_rst.py +75 -88
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rst_templates/index.rst.temp +3 -1
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rst_templates/section.rst.temp +2 -2
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/PKG-INFO +1 -1
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/LICENSE +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/MANIFEST.in +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/README.md +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/setup.cfg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/__init__.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/bash_qsub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/bashqsub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/bashqsub.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/gdex_ls.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/gdexls.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/gdexls.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/gdexls_standalone.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/pg_docs.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/pg_wget.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/pgwget.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_cp.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_kill.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_mod.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_own.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_ps.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_sub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rda_zip.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdacp.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdacp.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdakill.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdakill.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdals.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdals.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdamod.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdamod.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdaown.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdaown.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdaps.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdaps.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdasub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdasub.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdazip.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rdazip.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rst_templates/toc.rst.temp +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/tcsh_qsub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/tcshqsub.py +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/tcshqsub.usg +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/SOURCES.txt +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/dependency_links.txt +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/entry_points.txt +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/requires.txt +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/top_level.txt +0 -0
- {rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/tests/test_miscs.py +0 -0
|
@@ -139,19 +139,13 @@ class PgRST(PgFile, PgUtil):
|
|
|
139
139
|
|
|
140
140
|
self.parse_docs(docname)
|
|
141
141
|
if not self.sections: self.pglog(docname + ": empty document", self.LGWNEX)
|
|
142
|
-
|
|
143
142
|
self.DOCS['DOCNAM'] = docname
|
|
144
143
|
if docname in self.LINKS: self.LINKS.remove(docname)
|
|
145
144
|
self.DOCS['DOCLNK'] = r"({})".format('|'.join(self.LINKS))
|
|
146
145
|
self.DOCS['DOCTIT'] = docname.upper()
|
|
147
146
|
self.change_local_directory(self.DOCS['DOCDIR'], self.LGWNEX)
|
|
148
147
|
self.pglog("Write rst document '{}' under {}".format(docname, self.DOCS['DOCDIR']), self.LOGWRN)
|
|
149
|
-
|
|
150
|
-
if op.exists(op.join(self.DOCS['DOCDIR'], "index.rst")): # write index file once
|
|
151
|
-
self.pglog("index.rst exists already, delete first if needs to be regenerated", self.LOGWRN)
|
|
152
|
-
else:
|
|
153
|
-
self.write_index(self.sections[0])
|
|
154
|
-
|
|
148
|
+
self.write_index(self.sections[0])
|
|
155
149
|
for section in self.sections:
|
|
156
150
|
self.write_section(section)
|
|
157
151
|
|
|
@@ -183,7 +177,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
183
177
|
else:
|
|
184
178
|
line = line.rstrip() # remove trailing white spaces
|
|
185
179
|
|
|
186
|
-
ms = re.match(r'^([\d\.]+)\s+(.+)$', line)
|
|
180
|
+
ms = re.match(r'^([\d\.]+)\s+([A-Z].+)$', line)
|
|
187
181
|
if ms: # start new section
|
|
188
182
|
section = self.record_section(section, option, example, ms.group(1), ms.group(2))
|
|
189
183
|
option = example = None
|
|
@@ -284,15 +278,17 @@ class PgRST(PgFile, PgUtil):
|
|
|
284
278
|
"""
|
|
285
279
|
if example:
|
|
286
280
|
lines = example['desc'].split('\n')
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
281
|
+
lcnt = len(lines)
|
|
282
|
+
title = lines[0].strip()
|
|
283
|
+
ol = 1
|
|
284
|
+
if title[-1] != ':':
|
|
285
|
+
for l in range(1, lcnt):
|
|
286
|
+
line = lines[l].strip()
|
|
287
|
+
title += ' ' + line
|
|
288
|
+
ol += 1
|
|
289
|
+
if line[-1] == ':': break
|
|
290
|
+
example['desc'] = '\n'.join(lines[ol:]) if lcnt > ol else ''
|
|
291
|
+
example['title'] = title
|
|
296
292
|
option['exmidxs'].append(len(self.examples)) # record example index in option
|
|
297
293
|
self.examples.append(example) # record example globally
|
|
298
294
|
|
|
@@ -487,20 +483,18 @@ class PgRST(PgFile, PgUtil):
|
|
|
487
483
|
clevel = csection['level'] if csection else 0
|
|
488
484
|
csecid = csection['secid'] if csection else ""
|
|
489
485
|
depth = self.TLEVEL - clevel
|
|
486
|
+
level = clevel+1
|
|
487
|
+
preid = csecid+'.'
|
|
490
488
|
|
|
491
489
|
# nested bullet list for all sections
|
|
492
490
|
for section in self.sections:
|
|
493
491
|
secid = section['secid']
|
|
494
|
-
|
|
495
|
-
if
|
|
496
|
-
if not secid.startswith(csecid + "."): continue
|
|
497
|
-
elif level > (clevel+1):
|
|
498
|
-
continue
|
|
499
|
-
content += " section{}\n".format(secid)
|
|
492
|
+
if csecid and not secid.startswith(preid): continue
|
|
493
|
+
if section['level'] == level: content += " section{}\n".format(secid)
|
|
500
494
|
|
|
501
495
|
if not content: return ""
|
|
502
496
|
|
|
503
|
-
content = f".. toctree::\n :maxdepth: {depth}\n :caption: Table of Contents\n{content}\n"
|
|
497
|
+
content = f".. toctree::\n :maxdepth: {depth}\n :caption: Table of Contents\n\n{content}\n"
|
|
504
498
|
# appendix A: list of examples for the parent section and its subsections
|
|
505
499
|
appendix = ""
|
|
506
500
|
idx = 1 # used as example index
|
|
@@ -508,8 +502,8 @@ class PgRST(PgFile, PgUtil):
|
|
|
508
502
|
opt = exm['opt']
|
|
509
503
|
option = self.options[opt]
|
|
510
504
|
secid = option['secid']
|
|
511
|
-
if not csecid or secid == csecid or secid.startswith(
|
|
512
|
-
appendix += "-
|
|
505
|
+
if not csecid or secid == csecid or secid.startswith(preid):
|
|
506
|
+
appendix += "- :ref:`A.{}. {} Option -{} (-{}) <{}_e{}>`\n".format(
|
|
513
507
|
idx, option['type'], opt, option['name'], secid, idx)
|
|
514
508
|
idx += 1
|
|
515
509
|
if appendix:
|
|
@@ -577,7 +571,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
577
571
|
Emits a ``.. _<opt>:`` label followed by a title line of the form::
|
|
578
572
|
|
|
579
573
|
<Type> Option -**XX** (-**longname**) [Alias(es): ...] :
|
|
580
|
-
|
|
574
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
581
575
|
|
|
582
576
|
The ``~`` underline is sized to match the actual title line length
|
|
583
577
|
(including RST bold markers).
|
|
@@ -604,7 +598,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
604
598
|
|
|
605
599
|
content = "\n.. _{}:\n\n".format(opt)
|
|
606
600
|
content += title + "\n"
|
|
607
|
-
content += "
|
|
601
|
+
content += "^" * len(title) + "\n\n"
|
|
608
602
|
|
|
609
603
|
return content
|
|
610
604
|
|
|
@@ -673,33 +667,27 @@ class PgRST(PgFile, PgUtil):
|
|
|
673
667
|
|
|
674
668
|
for optary in opts:
|
|
675
669
|
opt = self.get_short_option(optary[1])
|
|
670
|
+
|
|
676
671
|
pre = optary[0]
|
|
677
672
|
after = optary[2]
|
|
678
673
|
secid = self.options[opt]['secid']
|
|
679
|
-
anchor =
|
|
680
|
-
|
|
681
|
-
anchor = opt
|
|
682
|
-
elif self.options[opt]['type'] == "Action":
|
|
683
|
-
anchor = "section{}".format(secid)
|
|
684
|
-
elif ptype == 2 and opt == "FN":
|
|
685
|
-
anchor = "field"
|
|
686
|
-
else:
|
|
687
|
-
anchor = "section{}".format(secid)
|
|
688
|
-
|
|
689
|
-
ms = re.search(r'-\(({}\|\w+)\)'.format(opt), line)
|
|
674
|
+
anchor = opt
|
|
675
|
+
ms = re.search(r'(-\({}\|\w+\))'.format(opt), line)
|
|
690
676
|
if ms:
|
|
691
677
|
if secid == csecid and ptype == 2: continue
|
|
692
678
|
opt = ms.group(1)
|
|
693
|
-
after = '
|
|
679
|
+
pre = after = ''
|
|
680
|
+
else:
|
|
681
|
+
ms = re.search(r'(-{})'.format(opt), line)
|
|
682
|
+
if ms:
|
|
683
|
+
opt = ms.group(1)
|
|
684
|
+
pre = pre[:-1]
|
|
694
685
|
|
|
695
686
|
replace = pre + opt + after
|
|
696
|
-
|
|
697
|
-
link = "{}`{}`_{}".format(pre, opt, after)
|
|
698
|
-
else:
|
|
699
|
-
link = "{}`{} <{}_>`_{}".format(pre, opt, anchor, after)
|
|
687
|
+
link = "{}:ref:`{} <{}>`{}".format(pre, opt, anchor, after)
|
|
700
688
|
line = line.replace(replace, link)
|
|
701
689
|
|
|
702
|
-
opts = re.findall(r'(^|\W){}(
|
|
690
|
+
opts = re.findall(r'(^|\W){}(\s+(o|O)ptions*\W|\W|$)'.format(self.SEARCH), line)
|
|
703
691
|
for optary in opts:
|
|
704
692
|
opt = optary[1]
|
|
705
693
|
if not self.SECIDS[opt]: continue
|
|
@@ -708,20 +696,14 @@ class PgRST(PgFile, PgUtil):
|
|
|
708
696
|
pre = optary[0]
|
|
709
697
|
after = optary[2]
|
|
710
698
|
replace = pre + opt + after
|
|
711
|
-
ms = re.search(r'(\
|
|
699
|
+
ms = re.search(r'(\s+Options*)\W', after, re.I)
|
|
712
700
|
if ms:
|
|
713
701
|
opt += ms.group(1)
|
|
714
702
|
after = after.replace(ms.group(1), '')
|
|
715
703
|
if ptype == 2 and re.search(r'Mode Options*', opt) and dtype == 3:
|
|
716
|
-
link = "{}
|
|
704
|
+
link = "{}:ref:`{} <mode{}>`{}".format(pre, opt, csecid, after)
|
|
717
705
|
else:
|
|
718
|
-
link = "{}
|
|
719
|
-
line = line.replace(replace, link)
|
|
720
|
-
|
|
721
|
-
ms = re.search(r'(https*://\S+)(\.|\,)', line)
|
|
722
|
-
if ms:
|
|
723
|
-
replace = ms.group(1)
|
|
724
|
-
link = "`{} <{}>`_".format(replace, replace)
|
|
706
|
+
link = "{}:ref:`{} <section{}>`{}".format(pre, opt, secid, after)
|
|
725
707
|
line = line.replace(replace, link)
|
|
726
708
|
|
|
727
709
|
# Q0...Q0 is a source-document quoting convention: Q0wordQ0 marks
|
|
@@ -776,7 +758,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
776
758
|
lines = []
|
|
777
759
|
ptype = 1
|
|
778
760
|
cnt = 0
|
|
779
|
-
elif cnt == 1 and re.match(r'^\s+%s\s(-|\[|
|
|
761
|
+
elif cnt == 1 and re.match(r'^\s+%s\s(-|\[|[a-z]\d{6}|[A-Z]{2}\s)' % self.DOCS['DOCNAM'], line):
|
|
780
762
|
ptype = 2
|
|
781
763
|
elif cnt > 0:
|
|
782
764
|
content += self.create_desc_content(lines, cnt, secid, dtype, ptype)
|
|
@@ -821,7 +803,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
821
803
|
|
|
822
804
|
* ``dtype=2`` with a ``<<Content ...>>`` header line: renders the
|
|
823
805
|
remaining lines as a verbatim content block.
|
|
824
|
-
* ``dtype=3``: prefixes "Mode options that…" lines with a ``.. _mode
|
|
806
|
+
* ``dtype=3``: prefixes "Mode options that…" lines with a ``.. _mode<secid>:``
|
|
825
807
|
anchor and "Use Info option -FN…" lines with a ``.. _field:`` anchor.
|
|
826
808
|
|
|
827
809
|
Args:
|
|
@@ -841,30 +823,27 @@ class PgRST(PgFile, PgUtil):
|
|
|
841
823
|
if dtype == 2:
|
|
842
824
|
ms = re.match(r'^<<(Content .*)>>$', line0)
|
|
843
825
|
if ms: # input files for examples
|
|
844
|
-
content += ms.group(1) + ":\n\n"
|
|
826
|
+
content += ms.group(1) + ":\n\n.. code-block:: none\n\n"
|
|
845
827
|
normal = 0
|
|
846
828
|
for i in range(1, cnt):
|
|
847
829
|
line = lines[i]
|
|
848
830
|
if doreplace and line.find('<:>') > -1 and not re.match(r'^[A-Z]\w+<:>[A-Z]\w+<:>', line):
|
|
849
831
|
doreplace = 0
|
|
850
832
|
if doreplace:
|
|
851
|
-
content += self.replace_option_link(line, secid, 0) + "\n"
|
|
833
|
+
content += ' '+self.replace_option_link(line, secid, 0) + "\n"
|
|
852
834
|
else:
|
|
853
|
-
content += line + "\n"
|
|
835
|
+
content += ' '+line + "\n"
|
|
854
836
|
if re.match(r'^\[\w+\]$', line): doreplace = 1
|
|
855
837
|
content += "\n"
|
|
856
838
|
if normal: # normal paragraph
|
|
857
839
|
ii = 0
|
|
858
840
|
if dtype == 3:
|
|
859
841
|
if re.match(r'^\s*Mode options* that ', line0):
|
|
860
|
-
content += ".. _mode:\n\n" + self.replace_option_link(line0, secid, 0) + "\n"
|
|
861
|
-
ii = 1
|
|
862
|
-
elif re.match(r'^\s*Use Info option -FN ', line0):
|
|
863
|
-
content += ".. _field:\n\n" + self.replace_option_link(line0, secid, 0) + "\n"
|
|
842
|
+
content += f".. _mode{secid}:\n\n" + self.replace_option_link(line0, secid, 0).strip() + "\n"
|
|
864
843
|
ii = 1
|
|
865
844
|
for i in range(ii, cnt):
|
|
866
845
|
line = lines[i]
|
|
867
|
-
content += self.replace_option_link(line, secid, 0) + "\n"
|
|
846
|
+
content += self.replace_option_link(line, secid, 0).strip() + "\n"
|
|
868
847
|
content += "\n"
|
|
869
848
|
|
|
870
849
|
return content
|
|
@@ -891,16 +870,17 @@ class PgRST(PgFile, PgUtil):
|
|
|
891
870
|
"""
|
|
892
871
|
line0 = lines[0]
|
|
893
872
|
ms = re.match(r'^\s+-\s+(.*)', line0)
|
|
894
|
-
if ms:
|
|
895
|
-
content = "
|
|
873
|
+
if ms:
|
|
874
|
+
content = "* " + self.replace_option_link(ms.group(1), secid, 1)
|
|
896
875
|
for i in range(1, cnt):
|
|
897
876
|
line = lines[i]
|
|
898
877
|
ms = re.match(r'^\s+-\s+(.*)', line)
|
|
899
878
|
if ms:
|
|
900
|
-
content += "* " + self.replace_option_link(ms.group(1), secid, 1)
|
|
879
|
+
content += "\n* " + self.replace_option_link(ms.group(1), secid, 1)
|
|
901
880
|
else:
|
|
902
|
-
|
|
903
|
-
|
|
881
|
+
|
|
882
|
+
content += " " + self.replace_option_link(line, secid, 1).lstrip()
|
|
883
|
+
content += "\n\n"
|
|
904
884
|
elif re.search(r'=>$', line0):
|
|
905
885
|
line = re.sub(r'={1,}', '=', line0)
|
|
906
886
|
content = "| {}\n".format(line)
|
|
@@ -934,22 +914,22 @@ class PgRST(PgFile, PgUtil):
|
|
|
934
914
|
prev_vals[1] += " " + self.replace_option_link(line, secid, 1)
|
|
935
915
|
if prev_vals:
|
|
936
916
|
rows.append(tuple(prev_vals))
|
|
937
|
-
content = self.
|
|
917
|
+
content = self.build_rst_list_table(rows)
|
|
938
918
|
else:
|
|
939
919
|
# multi-column table split on 2+ spaces
|
|
940
920
|
rows = []
|
|
941
921
|
for i in range(cnt):
|
|
942
|
-
line = lines[i]
|
|
922
|
+
line = lines[i].strip()
|
|
943
923
|
vals = re.split(r'\s{2,}', self.replace_option_link(line, secid, 1))
|
|
944
924
|
rows.append(vals)
|
|
945
|
-
content = self.
|
|
925
|
+
content = self.build_rst_simple_table(rows) + "\n"
|
|
946
926
|
|
|
947
927
|
return content
|
|
948
928
|
|
|
949
929
|
#
|
|
950
930
|
# build a two-column rst list-table
|
|
951
931
|
#
|
|
952
|
-
def
|
|
932
|
+
def build_rst_list_table(self, rows):
|
|
953
933
|
"""Render *rows* as an RST ``.. list-table::`` directive.
|
|
954
934
|
|
|
955
935
|
Args:
|
|
@@ -959,9 +939,11 @@ class PgRST(PgFile, PgUtil):
|
|
|
959
939
|
str: RST list-table directive string, or ``''`` if *rows* is empty.
|
|
960
940
|
"""
|
|
961
941
|
if not rows: return ""
|
|
962
|
-
content = ".. list-table::\n :widths: auto\n\n"
|
|
942
|
+
content = ".. list-table::\n :widths: auto\n :header-rows: 0\n\n"
|
|
963
943
|
for col0, col1 in rows:
|
|
944
|
+
if col0[0] == '-': col0 = col0[1:]
|
|
964
945
|
content += " * - {}\n".format(col0)
|
|
946
|
+
if col1[0] == '-': col1 = col1[1:]
|
|
965
947
|
content += " - {}\n".format(col1)
|
|
966
948
|
content += "\n"
|
|
967
949
|
return content
|
|
@@ -969,7 +951,7 @@ class PgRST(PgFile, PgUtil):
|
|
|
969
951
|
#
|
|
970
952
|
# build a multi-column rst simple table
|
|
971
953
|
#
|
|
972
|
-
def
|
|
954
|
+
def build_rst_simple_table(self, rows):
|
|
973
955
|
"""Render *rows* as an RST simple (grid-free) table.
|
|
974
956
|
|
|
975
957
|
Column widths are computed from the widest cell in each column, with a
|
|
@@ -990,11 +972,17 @@ class PgRST(PgFile, PgUtil):
|
|
|
990
972
|
if j < ncols:
|
|
991
973
|
widths[j] = max(widths[j], len(val), 1)
|
|
992
974
|
sep = " ".join("=" * w for w in widths) + "\n"
|
|
993
|
-
content = sep
|
|
975
|
+
# content = sep
|
|
976
|
+
content = ".. list-table::\n :widths: auto\n :header-rows: 1\n\n"
|
|
994
977
|
for row in rows:
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
978
|
+
v = row[0] + "\n"
|
|
979
|
+
if len(v) > 1 and v[0] == '-': v = v[1:]
|
|
980
|
+
content += " * - " + v
|
|
981
|
+
for c in range(1, ncols):
|
|
982
|
+
v = row[c] + "\n"
|
|
983
|
+
if len(v) > 1 and v[0] == '-': v = v[1:]
|
|
984
|
+
content += " - " + v
|
|
985
|
+
|
|
998
986
|
return content
|
|
999
987
|
|
|
1000
988
|
#
|
|
@@ -1021,14 +1009,11 @@ class PgRST(PgFile, PgUtil):
|
|
|
1021
1009
|
|
|
1022
1010
|
for i in range(cnt):
|
|
1023
1011
|
line = self.replace_option_link(lines[i], secid, 2, dtype)
|
|
1024
|
-
|
|
1025
|
-
|
|
1012
|
+
ms = re.match(r'^\s*{}\s+(.+)$'.format(self.DOCS['DOCNAM']), line)
|
|
1013
|
+
if ms:
|
|
1014
|
+
content += "| {}{}{} {}\n".format(self.Q1, self.DOCS['DOCNAM'], self.Q2, ms.group(1))
|
|
1026
1015
|
else:
|
|
1027
|
-
|
|
1028
|
-
if ms:
|
|
1029
|
-
content += "| {}{}{} {}\n".format(self.Q1, self.DOCS['DOCNAM'], self.Q2, ms.group(1))
|
|
1030
|
-
else:
|
|
1031
|
-
content += "|{}\n".format(line)
|
|
1016
|
+
content += "| "+line+"\n"
|
|
1032
1017
|
content += "\n"
|
|
1033
1018
|
|
|
1034
1019
|
return content
|
|
@@ -1076,9 +1061,11 @@ class PgRST(PgFile, PgUtil):
|
|
|
1076
1061
|
Returns:
|
|
1077
1062
|
str: RST `` `title <sectionN>`_ `` link, or *title* if not found.
|
|
1078
1063
|
"""
|
|
1064
|
+
ltitle = title.lower()
|
|
1065
|
+
if ltitle == "info options": ltitle = 'information options'
|
|
1079
1066
|
for section in self.sections:
|
|
1080
|
-
if
|
|
1081
|
-
return "
|
|
1067
|
+
if ltitle == section['title'].lower():
|
|
1068
|
+
return ":ref:`{} <section{}>`".format(title, section['secid'])
|
|
1082
1069
|
|
|
1083
1070
|
return title
|
|
1084
1071
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs/rst_templates/toc.rst.temp
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/requires.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.6 → rda_python_miscs-2.0.7}/src/rda_python_miscs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|