rda-python-miscs 2.0.4__tar.gz → 2.0.5__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.
Files changed (54) hide show
  1. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/PKG-INFO +1 -1
  2. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/pyproject.toml +1 -1
  3. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_rst.py +19 -28
  4. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rst_templates/index.rst.temp +3 -8
  5. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rst_templates/section.rst.temp +0 -3
  6. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/PKG-INFO +1 -1
  7. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/LICENSE +0 -0
  8. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/MANIFEST.in +0 -0
  9. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/README.md +0 -0
  10. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/setup.cfg +0 -0
  11. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/__init__.py +0 -0
  12. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bash_qsub.py +0 -0
  13. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bashqsub.py +0 -0
  14. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bashqsub.usg +0 -0
  15. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdex_ls.py +0 -0
  16. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls.py +0 -0
  17. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls.usg +0 -0
  18. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls_standalone.py +0 -0
  19. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_docs.py +0 -0
  20. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_wget.py +0 -0
  21. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pgwget.py +0 -0
  22. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_cp.py +0 -0
  23. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_kill.py +0 -0
  24. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_mod.py +0 -0
  25. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_own.py +0 -0
  26. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_ps.py +0 -0
  27. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_sub.py +0 -0
  28. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_zip.py +0 -0
  29. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdacp.py +0 -0
  30. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdacp.usg +0 -0
  31. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdakill.py +0 -0
  32. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdakill.usg +0 -0
  33. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdals.py +0 -0
  34. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdals.usg +0 -0
  35. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdamod.py +0 -0
  36. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdamod.usg +0 -0
  37. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaown.py +0 -0
  38. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaown.usg +0 -0
  39. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaps.py +0 -0
  40. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaps.usg +0 -0
  41. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdasub.py +0 -0
  42. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdasub.usg +0 -0
  43. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdazip.py +0 -0
  44. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdazip.usg +0 -0
  45. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rst_templates/toc.rst.temp +0 -0
  46. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcsh_qsub.py +0 -0
  47. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcshqsub.py +0 -0
  48. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcshqsub.usg +0 -0
  49. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/SOURCES.txt +0 -0
  50. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/dependency_links.txt +0 -0
  51. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/entry_points.txt +0 -0
  52. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/requires.txt +0 -0
  53. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/top_level.txt +0 -0
  54. {rda_python_miscs-2.0.4 → rda_python_miscs-2.0.5}/tests/test_miscs.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_miscs
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: RDA Python package to hold RDA miscellaneous utility programs
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-miscs
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
 
7
7
  [project]
8
8
  name = "rda_python_miscs"
9
- version = "2.0.4"
9
+ version = "2.0.5"
10
10
  authors = [
11
11
  { name="Zaihua Ji", email="zji@ucar.edu" },
12
12
  ]
@@ -129,7 +129,7 @@ class PgRST(PgFile, PgUtil):
129
129
 
130
130
  This is the main entry point. It populates ``self.sections``,
131
131
  ``self.options``, and ``self.examples`` by calling ``parse_docs``, then
132
- writes ``index.rst``, ``toc.rst``, and one ``section<id>.rst`` per
132
+ writes ``index.rst`` and one ``section<id>.rst`` per
133
133
  section into ``DOCDIR``.
134
134
 
135
135
  Args:
@@ -155,8 +155,6 @@ class PgRST(PgFile, PgUtil):
155
155
  else:
156
156
  self.write_index(self.sections[0])
157
157
 
158
- self.write_toc()
159
-
160
158
  for section in self.sections:
161
159
  self.write_section(section)
162
160
 
@@ -404,29 +402,17 @@ class PgRST(PgFile, PgUtil):
404
402
  def write_index(self, section):
405
403
  """Write ``index.rst`` from the ``index.rst.temp`` template.
406
404
 
407
- Passes ``TITLE`` (document title) and ``SECID`` (first section id)
408
- as substitution variables.
405
+ Passes ``TITLE`` (document title), ``SECID`` (first section id),
406
+ and the generated ``TOC`` RST content as substitution variables.
409
407
 
410
408
  Args:
411
409
  section (dict): The first section dict, used to supply ``SECID``.
412
410
  """
413
- hash = {'TITLE' : self.DOCS['DOCTIT'], 'SECID' : section['secid']}
411
+ hash = {'TITLE' : self.DOCS['DOCTIT'], 'SECID' : section['secid'],
412
+ 'TOC' : self.create_toc()}
414
413
 
415
414
  self.template_to_rst("index", hash)
416
415
 
417
- #
418
- # write the table of contents: toc.rst
419
- #
420
- def write_toc(self):
421
- """Write ``toc.rst`` from the ``toc.rst.temp`` template.
422
-
423
- Passes ``TITLE`` and the generated ``TOC`` RST content as substitution
424
- variables.
425
- """
426
- hash = {'TITLE' : self.DOCS['DOCTIT'], 'TOC' : self.create_toc()}
427
-
428
- self.template_to_rst("toc", hash)
429
-
430
416
  #
431
417
  # write a section rst file
432
418
  #
@@ -651,8 +637,9 @@ class PgRST(PgFile, PgUtil):
651
637
  """Scan *line* for option references, section-category keywords, URLs, and
652
638
  quoted program names, and replace each with an RST hyperlink.
653
639
 
654
- Link targets are formatted as RST anonymous hyperlinks:
655
- `` `text <url>`_ ``.
640
+ All links use RST named anchor references (`` `name`_ `` or
641
+ `` `text <name_>`_ ``) targeting anchors of the form ``.. _name:``.
642
+ Cross-file option links target ``.. _section{secid}:`` anchors.
656
643
 
657
644
  Args:
658
645
  line (str): Source text line to process.
@@ -687,14 +674,15 @@ class PgRST(PgFile, PgUtil):
687
674
  pre = optary[0]
688
675
  after = optary[2]
689
676
  secid = self.options[opt]['secid']
677
+ anchor = None # RST anchor name for same-file or cross-file links (.. _NAME:)
690
678
  if secid == csecid:
691
- link = "#{}".format(opt)
679
+ anchor = opt
692
680
  elif self.options[opt]['type'] == "Action":
693
- link = "section{}.rst".format(secid)
681
+ anchor = "section{}".format(secid)
694
682
  elif ptype == 2 and opt == "FN":
695
- link = "#field"
683
+ anchor = "field"
696
684
  else:
697
- link = "section{}.rst#{}".format(secid, opt)
685
+ anchor = "section{}".format(secid)
698
686
 
699
687
  ms = re.search(r'-\(({}\|\w+)\)'.format(opt), line)
700
688
  if ms:
@@ -703,7 +691,10 @@ class PgRST(PgFile, PgUtil):
703
691
  after = ')'
704
692
 
705
693
  replace = pre + opt + after
706
- link = "{}`{} <{}>`_{}".format(pre, opt, link, after)
694
+ if opt == anchor:
695
+ link = "{}`{}`_{}".format(pre, opt, after)
696
+ else:
697
+ link = "{}`{} <{}_>`_{}".format(pre, opt, anchor, after)
707
698
  line = line.replace(replace, link)
708
699
 
709
700
  opts = re.findall(r'(^|\W){}( Options*\W|\W|$)'.format(self.SEARCH), line)
@@ -720,9 +711,9 @@ class PgRST(PgFile, PgUtil):
720
711
  opt += ms.group(1)
721
712
  after = after.replace(ms.group(1), '')
722
713
  if ptype == 2 and re.search(r'Mode Options*', opt) and dtype == 3:
723
- link = "{}`{} <#mode>`_{}".format(pre, opt, after)
714
+ link = "{}`{} <mode_>`_{}".format(pre, opt, after)
724
715
  else:
725
- link = "{}`{} <section{}.rst>`_{}".format(pre, opt, secid, after)
716
+ link = "{}`{} <section{}_>`_{}".format(pre, opt, secid, after)
726
717
  line = line.replace(replace, link)
727
718
 
728
719
  ms = re.search(r'(https*://\S+)(\.|\,)', line)
@@ -15,15 +15,10 @@
15
15
  A GUIDE TO __TITLE__
16
16
  ============================
17
17
 
18
- .. contents:: Table of Contents
19
- :depth: 2
20
- :local:
21
-
22
- See the :doc:`toc` for the full table of contents.
23
-
24
18
  .. toctree::
25
19
  :maxdepth: 2
26
20
  :caption: Contents
27
21
 
28
- toc
29
- section__SECID__
22
+ section__SECID__
23
+
24
+ __TOC__
@@ -16,8 +16,5 @@ __SECID__ - __TITLE__
16
16
 
17
17
  __SECTION__
18
18
 
19
- .. raw:: html
20
-
21
- <br>
22
19
 
23
20
  :ref:`Back to Top <index>`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_miscs
3
- Version: 2.0.4
3
+ Version: 2.0.5
4
4
  Summary: RDA Python package to hold RDA miscellaneous utility programs
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-miscs