rda-python-miscs 2.0.3__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.
- rda_python_miscs-2.0.5/MANIFEST.in +2 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/PKG-INFO +1 -1
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/pyproject.toml +1 -1
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_rst.py +40 -47
- rda_python_miscs-2.0.5/src/rda_python_miscs/rst_templates/index.rst.temp +24 -0
- rda_python_miscs-2.0.5/src/rda_python_miscs/rst_templates/section.rst.temp +20 -0
- rda_python_miscs-2.0.5/src/rda_python_miscs/rst_templates/toc.rst.temp +21 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/PKG-INFO +1 -1
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/SOURCES.txt +3 -0
- rda_python_miscs-2.0.3/MANIFEST.in +0 -1
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/LICENSE +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/README.md +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/setup.cfg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/__init__.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bash_qsub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bashqsub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/bashqsub.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdex_ls.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/gdexls_standalone.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_docs.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pg_wget.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/pgwget.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_cp.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_kill.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_mod.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_own.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_ps.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_sub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rda_zip.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdacp.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdacp.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdakill.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdakill.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdals.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdals.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdamod.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdamod.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaown.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaown.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaps.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdaps.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdasub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdasub.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdazip.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/rdazip.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcsh_qsub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcshqsub.py +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs/tcshqsub.usg +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/dependency_links.txt +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/entry_points.txt +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/requires.txt +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/top_level.txt +0 -0
- {rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/tests/test_miscs.py +0 -0
|
@@ -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
|
|
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)
|
|
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
|
-
|
|
655
|
-
`` `text <
|
|
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
|
-
|
|
679
|
+
anchor = opt
|
|
692
680
|
elif self.options[opt]['type'] == "Action":
|
|
693
|
-
|
|
681
|
+
anchor = "section{}".format(secid)
|
|
694
682
|
elif ptype == 2 and opt == "FN":
|
|
695
|
-
|
|
683
|
+
anchor = "field"
|
|
696
684
|
else:
|
|
697
|
-
|
|
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
|
-
|
|
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 = "{}`{}
|
|
714
|
+
link = "{}`{} <mode_>`_{}".format(pre, opt, after)
|
|
724
715
|
else:
|
|
725
|
-
link = "{}`{} <section{}
|
|
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)
|
|
@@ -1119,9 +1110,10 @@ class PgRST(PgFile, PgUtil):
|
|
|
1119
1110
|
|
|
1120
1111
|
Resolution order for OPTS / ALIAS:
|
|
1121
1112
|
|
|
1122
|
-
1.
|
|
1123
|
-
|
|
1124
|
-
|
|
1113
|
+
1. The first class *defined in that module* that carries ``OPTS``
|
|
1114
|
+
as a class-level attribute.
|
|
1115
|
+
2. Module-level ``OPTS`` / ``ALIAS`` attributes (fallback when no
|
|
1116
|
+
qualifying class is found).
|
|
1125
1117
|
|
|
1126
1118
|
``ALIAS`` is optional; an empty dict is returned when not found.
|
|
1127
1119
|
|
|
@@ -1155,25 +1147,26 @@ class PgRST(PgFile, PgUtil):
|
|
|
1155
1147
|
# Derive ORIGIN from the module's own file path.
|
|
1156
1148
|
origin = op.dirname(op.abspath(mod.__file__))
|
|
1157
1149
|
|
|
1158
|
-
# 1.
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1150
|
+
# 1. Find the first class defined in this module and read OPTS / ALIAS from it.
|
|
1151
|
+
cls = next(
|
|
1152
|
+
(obj for _, obj in inspect.getmembers(mod, inspect.isclass)
|
|
1153
|
+
if obj.__module__ == modname),
|
|
1154
|
+
None,
|
|
1155
|
+
)
|
|
1156
|
+
|
|
1157
|
+
if cls is not None:
|
|
1158
|
+
obj = cls()
|
|
1159
|
+
opts = getattr(obj, 'OPTS', None)
|
|
1160
|
+
alias = getattr(obj, 'ALIAS', None)
|
|
1161
|
+
else:
|
|
1162
|
+
# 2. Fall back to module-level attributes when no class is found.
|
|
1163
|
+
opts = getattr(mod, 'OPTS', None)
|
|
1164
|
+
alias = getattr(mod, 'ALIAS', None)
|
|
1172
1165
|
|
|
1173
1166
|
if opts is None:
|
|
1174
1167
|
self.pglog(
|
|
1175
|
-
"Module '{}' does not define OPTS (checked
|
|
1176
|
-
"
|
|
1168
|
+
"Module '{}' does not define OPTS (checked class and "
|
|
1169
|
+
"module level)".format(modname),
|
|
1177
1170
|
self.LGWNEX,
|
|
1178
1171
|
)
|
|
1179
1172
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
#
|
|
3
|
+
# Title : index.temp
|
|
4
|
+
# Author : Zaihua Ji, zji@ucar.edu
|
|
5
|
+
# Date : 03/17/2026
|
|
6
|
+
# Purpose : template file for help document index.rst (reStructuredText)
|
|
7
|
+
#
|
|
8
|
+
# Work File : $DSSHOME/lib/templates/index.temp
|
|
9
|
+
#
|
|
10
|
+
################################################################################
|
|
11
|
+
|
|
12
|
+
.. _index:
|
|
13
|
+
|
|
14
|
+
============================
|
|
15
|
+
A GUIDE TO __TITLE__
|
|
16
|
+
============================
|
|
17
|
+
|
|
18
|
+
.. toctree::
|
|
19
|
+
:maxdepth: 2
|
|
20
|
+
:caption: Contents
|
|
21
|
+
|
|
22
|
+
section__SECID__
|
|
23
|
+
|
|
24
|
+
__TOC__
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
#
|
|
3
|
+
# Title : section.temp
|
|
4
|
+
# Author : Zaihua Ji, zji@ucar.edu
|
|
5
|
+
# Date : 03/17/2026
|
|
6
|
+
# Purpose : template file for help document section.rst (reStructuredText)
|
|
7
|
+
#
|
|
8
|
+
# Work File : $DSSHOME/lib/templates/section.temp
|
|
9
|
+
#
|
|
10
|
+
################################################################################
|
|
11
|
+
|
|
12
|
+
.. _section__SECID__:
|
|
13
|
+
|
|
14
|
+
__SECID__ - __TITLE__
|
|
15
|
+
=====================
|
|
16
|
+
|
|
17
|
+
__SECTION__
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
:ref:`Back to Top <index>`
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
################################################################################
|
|
2
|
+
#
|
|
3
|
+
# Title : toc.temp
|
|
4
|
+
# Author : Zaihua Ji, zji@ucar.edu
|
|
5
|
+
# Date : 03/17/2026
|
|
6
|
+
# Purpose : template file for help document toc.rst (table of contents, RST)
|
|
7
|
+
#
|
|
8
|
+
# Work File : $DSSHOME/lib/templates/toc.temp
|
|
9
|
+
#
|
|
10
|
+
################################################################################
|
|
11
|
+
|
|
12
|
+
.. _toc:
|
|
13
|
+
|
|
14
|
+
====================
|
|
15
|
+
__TITLE__ Guide
|
|
16
|
+
====================
|
|
17
|
+
|
|
18
|
+
Table of Contents
|
|
19
|
+
-----------------
|
|
20
|
+
|
|
21
|
+
__TOC__
|
|
@@ -46,4 +46,7 @@ src/rda_python_miscs.egg-info/dependency_links.txt
|
|
|
46
46
|
src/rda_python_miscs.egg-info/entry_points.txt
|
|
47
47
|
src/rda_python_miscs.egg-info/requires.txt
|
|
48
48
|
src/rda_python_miscs.egg-info/top_level.txt
|
|
49
|
+
src/rda_python_miscs/rst_templates/index.rst.temp
|
|
50
|
+
src/rda_python_miscs/rst_templates/section.rst.temp
|
|
51
|
+
src/rda_python_miscs/rst_templates/toc.rst.temp
|
|
49
52
|
tests/test_miscs.py
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
include src/rda_python_miscs/*.usg
|
|
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
|
|
File without changes
|
|
File without changes
|
{rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/entry_points.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/requires.txt
RENAMED
|
File without changes
|
{rda_python_miscs-2.0.3 → rda_python_miscs-2.0.5}/src/rda_python_miscs.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|