rda-python-miscs 2.0.3__py3-none-any.whl → 2.0.4__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.
@@ -1119,9 +1119,10 @@ class PgRST(PgFile, PgUtil):
1119
1119
 
1120
1120
  Resolution order for OPTS / ALIAS:
1121
1121
 
1122
- 1. Module-level ``OPTS`` / ``ALIAS`` attributes.
1123
- 2. The first class *defined in that module* that carries both ``OPTS``
1124
- and ``ALIAS`` as class-level attributes.
1122
+ 1. The first class *defined in that module* that carries ``OPTS``
1123
+ as a class-level attribute.
1124
+ 2. Module-level ``OPTS`` / ``ALIAS`` attributes (fallback when no
1125
+ qualifying class is found).
1125
1126
 
1126
1127
  ``ALIAS`` is optional; an empty dict is returned when not found.
1127
1128
 
@@ -1155,25 +1156,26 @@ class PgRST(PgFile, PgUtil):
1155
1156
  # Derive ORIGIN from the module's own file path.
1156
1157
  origin = op.dirname(op.abspath(mod.__file__))
1157
1158
 
1158
- # 1. Try module-level attributes first.
1159
- opts = getattr(mod, 'OPTS', None)
1160
- alias = getattr(mod, 'ALIAS', None)
1161
-
1162
- # 2. Fall back to the first class in the module that owns both.
1163
- if opts is None or alias is None:
1164
- for _, obj in inspect.getmembers(mod, inspect.isclass):
1165
- if obj.__module__ == modname:
1166
- cls_opts = getattr(obj, 'OPTS', None)
1167
- cls_alias = getattr(obj, 'ALIAS', None)
1168
- if cls_opts is not None:
1169
- if opts is None: opts = cls_opts
1170
- if alias is None: alias = cls_alias
1171
- break
1159
+ # 1. Find the first class defined in this module and read OPTS / ALIAS from it.
1160
+ cls = next(
1161
+ (obj for _, obj in inspect.getmembers(mod, inspect.isclass)
1162
+ if obj.__module__ == modname),
1163
+ None,
1164
+ )
1165
+
1166
+ if cls is not None:
1167
+ obj = cls()
1168
+ opts = getattr(obj, 'OPTS', None)
1169
+ alias = getattr(obj, 'ALIAS', None)
1170
+ else:
1171
+ # 2. Fall back to module-level attributes when no class is found.
1172
+ opts = getattr(mod, 'OPTS', None)
1173
+ alias = getattr(mod, 'ALIAS', None)
1172
1174
 
1173
1175
  if opts is None:
1174
1176
  self.pglog(
1175
- "Module '{}' does not define OPTS (checked module level and "
1176
- "all classes defined in the module)".format(modname),
1177
+ "Module '{}' does not define OPTS (checked class and "
1178
+ "module level)".format(modname),
1177
1179
  self.LGWNEX,
1178
1180
  )
1179
1181
 
@@ -0,0 +1,29 @@
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
+ .. contents:: Table of Contents
19
+ :depth: 2
20
+ :local:
21
+
22
+ See the :doc:`toc` for the full table of contents.
23
+
24
+ .. toctree::
25
+ :maxdepth: 2
26
+ :caption: Contents
27
+
28
+ toc
29
+ section__SECID__
@@ -0,0 +1,23 @@
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
+ .. raw:: html
20
+
21
+ <br>
22
+
23
+ :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__
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_miscs
3
- Version: 2.0.3
3
+ Version: 2.0.4
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
@@ -7,7 +7,7 @@ rda_python_miscs/gdexls.py,sha256=Wh4tQgKmoQ3YrlXN0etlhK5CDqvFzH75cRZgUtUGBDc,10
7
7
  rda_python_miscs/gdexls.usg,sha256=aJ_bPgKkgmhoXVFV7rdTpwb9odM_pygI3clppQ1-3cM,2953
8
8
  rda_python_miscs/gdexls_standalone.py,sha256=YcKnJ0Zm0SbZET4X8IQnrEyoAsHp5estUpOfWEIToQU,453
9
9
  rda_python_miscs/pg_docs.py,sha256=_AoqrWroUu7FQMVWaTSTZBQMwi1BH1-RjKb1nDHgxOI,25369
10
- rda_python_miscs/pg_rst.py,sha256=nEnl_vUcbPCu-PvDl7z6SexN3eZIcn1ruEG4fAGSysY,45271
10
+ rda_python_miscs/pg_rst.py,sha256=5VEQRQ9miJnrIFBKYQL8jq4D4l3azQ4yTRuyZHZtVCE,45204
11
11
  rda_python_miscs/pg_wget.py,sha256=DHBOL9CMP0cRvLR8mEG5HqX2nRfgzb2C5WvIbgqCrOE,6815
12
12
  rda_python_miscs/pgwget.py,sha256=lsFKIX8Xhsz2yHpgbTCuWWQ57XcZJgVKB2jJi7h3oec,7622
13
13
  rda_python_miscs/rda_cp.py,sha256=Voear5P9tbBO63vjSs3lCIUxqXxfI6QtWVpM6w9KRzM,7132
@@ -36,9 +36,12 @@ rda_python_miscs/rdazip.usg,sha256=V4tCymlIZObIXRT3wPILKBWfmpV0mre1SlXBlg4ZG1k,5
36
36
  rda_python_miscs/tcsh_qsub.py,sha256=P4Obzbp5Dvy-N0eRR5F51R9yj3ttWJo6g1NqyVDO6-Y,6670
37
37
  rda_python_miscs/tcshqsub.py,sha256=wk711Ou_SwfcIrPGDUiGofTA_qabKGAFg1w6iZYc-ZU,7534
38
38
  rda_python_miscs/tcshqsub.usg,sha256=VttA4Sv4Rbx2VoajwEvfdO0StPGRlSoK9RpU3iHuMDY,2164
39
- rda_python_miscs-2.0.3.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
40
- rda_python_miscs-2.0.3.dist-info/METADATA,sha256=jd7BrAZQB41gpisciI2aQeu0dmFdv0hG-nEwpeZDkuw,669
41
- rda_python_miscs-2.0.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
42
- rda_python_miscs-2.0.3.dist-info/entry_points.txt,sha256=qKg-5kE64N8sgiR4Bd0qzGqHBUun8WwOZhIE-GXzbVQ,524
43
- rda_python_miscs-2.0.3.dist-info/top_level.txt,sha256=W5rz7DrWb7hXABUbGgWcwe6D644X338LR8_zdgmtLhg,17
44
- rda_python_miscs-2.0.3.dist-info/RECORD,,
39
+ rda_python_miscs/rst_templates/index.rst.temp,sha256=ozjIV1I6Lz4eGc093zGuo4jmOrjgXqY5z-Yfeqhys7Y,660
40
+ rda_python_miscs/rst_templates/section.rst.temp,sha256=-FH3JI4-9K-U894LPI7Ft3W6U7Nz6qmzJQ9iaiBTchI,518
41
+ rda_python_miscs/rst_templates/toc.rst.temp,sha256=iNX5SzDDcvElNs7u36vNuCsxFR9xyGl_d7INe58-59s,494
42
+ rda_python_miscs-2.0.4.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
43
+ rda_python_miscs-2.0.4.dist-info/METADATA,sha256=-LAoAguZLopl8Jf2QKGqtQcRIxQtMeCVAMFis3OPGxc,669
44
+ rda_python_miscs-2.0.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
45
+ rda_python_miscs-2.0.4.dist-info/entry_points.txt,sha256=qKg-5kE64N8sgiR4Bd0qzGqHBUun8WwOZhIE-GXzbVQ,524
46
+ rda_python_miscs-2.0.4.dist-info/top_level.txt,sha256=W5rz7DrWb7hXABUbGgWcwe6D644X338LR8_zdgmtLhg,17
47
+ rda_python_miscs-2.0.4.dist-info/RECORD,,