rda-python-common 3.0.31__py3-none-any.whl → 3.0.32__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.
@@ -22,7 +22,7 @@ object that existing callers expect.
22
22
 
23
23
  from . import PgLOG, PgUtil, PgDBI, PgFile, PgLock, PgCMD, PgSIG, PgOPT, PgSplit
24
24
 
25
- __version__ = "3.0.31"
25
+ __version__ = "3.0.32"
26
26
 
27
27
  __all__ = [
28
28
  "PgLOG",
@@ -487,7 +487,7 @@ class PgSIG(PgDBI):
487
487
  if not dumpon: self.set_dump(self.SDUMP['DEF'])
488
488
  if signum == signal.SIGQUIT: self.PGSIG['QUIT'] = 1
489
489
  if self.PGSIG['PPID'] <= 1 and len(self.CPIDS) > 0: # passing signal to child processes
490
- for pid in self.CPIDS: self.kill_process(pid, signum)
490
+ for pid in list(self.CPIDS): self.kill_process(pid, signum) # SIGCHLD may change CPIDS
491
491
 
492
492
  # catch the termination signal so a batch run gets a chance to report before it dies
493
493
  # PBS kills a job that runs out of walltime with SIGTERM first and SIGKILL a few seconds
@@ -829,8 +829,8 @@ class PgSIG(PgDBI):
829
829
  Returns:
830
830
  int: The child PID, or 0 if not found.
831
831
  """
832
- for cpid in self.CPIDS:
833
- if self.CPIDS[cpid] == pname: return cpid
832
+ for cpid, cname in list(self.CPIDS.items()): # a copy: SIGCHLD may remove entries meanwhile
833
+ if cname == pname: return cpid
834
834
  return 0
835
835
 
836
836
  # check one or all child processes if they are still running
@@ -870,15 +870,15 @@ class PgSIG(PgDBI):
870
870
  else:
871
871
  self.pglog("{}: Child still running".format(pid), logact)
872
872
  pcnt = 1
873
- elif pid in self.CPIDS:
874
- del self.CPIDS[pid] # clean the saved info for the process
873
+ else:
874
+ self.CPIDS.pop(pid, None) # clean the saved info; SIGCHLD may have removed it
875
875
  elif not pname:
876
876
  cpids = list(self.CPIDS)
877
877
  for cpid in cpids:
878
878
  if self.check_process(cpid): # process is not done yet
879
879
  pcnt += 1
880
- elif cpid in self.CPIDS:
881
- del self.CPIDS[cpid]
880
+ else:
881
+ self.CPIDS.pop(cpid, None)
882
882
  if pcnt == 0 or dowait == 0 or pcnt < ccnt: break
883
883
  self.show_wait_message(i, "{}: wait {}/{} child processes".format(self.PGSIG['DSTR'], pcnt, self.PGSIG['MPROC']), logact, dowait)
884
884
  i += 1
@@ -1241,8 +1241,8 @@ class PgSIG(PgDBI):
1241
1241
  Returns:
1242
1242
  int: The background process ID, or 0 if not found.
1243
1243
  """
1244
- for cbid in self.CBIDS:
1245
- if self.CBIDS[cbid] == bcmd: return cbid
1244
+ for cbid, ccmd in list(self.CBIDS.items()): # a copy: SIGCHLD may remove entries meanwhile
1245
+ if ccmd == bcmd: return cbid
1246
1246
  return 0
1247
1247
 
1248
1248
  # check one or all child processes if they are still running
@@ -1274,8 +1274,8 @@ class PgSIG(PgDBI):
1274
1274
  else:
1275
1275
  self.pglog("{}: Background process still running".format(bid), logact)
1276
1276
  bcnt = 1
1277
- elif bid in self.CBIDS:
1278
- del self.CBIDS[bid] # clean the saved info for the process
1277
+ else:
1278
+ self.CBIDS.pop(bid, None) # clean the saved info; SIGCHLD may have removed it
1279
1279
  elif not bcmd:
1280
1280
  # Bug fix: cannot delete from a dict while iterating over it;
1281
1281
  # iterate over a copy of the keys instead.
@@ -1284,7 +1284,7 @@ class PgSIG(PgDBI):
1284
1284
  if self.check_process(cbid): # process is not done yet
1285
1285
  bcnt += 1
1286
1286
  else:
1287
- if cbid in self.CBIDS: del self.CBIDS[cbid] # SIGCHLD may have removed it
1287
+ self.CBIDS.pop(cbid, None) # SIGCHLD may have removed it
1288
1288
  if not (bcnt and dowait): break
1289
1289
  self.show_wait_message(i, "{}: wait {}/{} background processes".format(self.PGSIG['DSTR'], bcnt, self.PGSIG['BPROC']), logact, dowait)
1290
1290
  i += 1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rda_python_common
3
- Version: 3.0.31
3
+ Version: 3.0.32
4
4
  Summary: RDA Python common library codes shared by other RDA python packages
5
5
  Author-email: Zaihua Ji <zji@ucar.edu>
6
6
  Project-URL: Homepage, https://github.com/NCAR/rda-python-common
@@ -189,7 +189,7 @@ PgLOG.pglog("hello", PgLOG.LOGWRN)
189
189
  python -c "import rda_python_common; print(rda_python_common.__version__)"
190
190
  ```
191
191
 
192
- You should see the installed version (currently `3.0.31`). If the import
192
+ You should see the installed version (currently `3.0.32`). If the import
193
193
  fails, double-check that the active Python environment is the one where you
194
194
  ran `pip install`.
195
195
 
@@ -7,7 +7,7 @@ rda_python_common/PgOPT.py,sha256=0nQPF19N-1VWwrjFHEeruVSwVDwvFKd4uowPc8dK7e4,56
7
7
  rda_python_common/PgSIG.py,sha256=0MJPH0fTtSshIsvUXkzQjReHPyCWdzHYOY5LbFSh7-A,34318
8
8
  rda_python_common/PgSplit.py,sha256=En7xcdkE4YNRcMX88qXnrUgUOnQU3Kqh8uxRIdlJhEA,9156
9
9
  rda_python_common/PgUtil.py,sha256=7hXAznAI8tYh-nJRKBIXejNe2ROQ2Wxn28OAndeg0Iw,48433
10
- rda_python_common/__init__.py,sha256=FTPc_6PSJ2E2CjQET_-Dbs3zGy8sewMbnI7GMCtQXbk,995
10
+ rda_python_common/__init__.py,sha256=7vknjjYyG_aC7QbPbXubi2BuMQLM0sMe7jmbraVqdPo,995
11
11
  rda_python_common/pg_cmd.py,sha256=MYldUuM8mSUIT34yKQyUd0i4NL4zdSB8C6Jcc28NRxA,33809
12
12
  rda_python_common/pg_dbi.py,sha256=ASIW2vsIjMab2TMfhqJiXS7LQhKKGpKjzNMqo7RCePw,122415
13
13
  rda_python_common/pg_file.py,sha256=7NipcgMy4t67zbH2MHtRL3vxyY1FHdIgMTQ-kE0H2fA,181122
@@ -15,14 +15,14 @@ rda_python_common/pg_lock.py,sha256=31EaVDjCkcx3-n8-KnzG18R8Pz7Z6KyFsEqcml6Iq5c,
15
15
  rda_python_common/pg_log.py,sha256=erQN4YYPwiORa3OE0Jt8s05rlWsjtyIs0fJ_KLbNAQ8,82959
16
16
  rda_python_common/pg_opt.py,sha256=LxVAf47wi2STkVGSXMvV3IZphEJcoO8bvYXy6kQ5ox4,82403
17
17
  rda_python_common/pg_password.py,sha256=X-eIDwdqBhtrhrbDTNWle-0JtWsyIVZdDOZaBu7cFHM,2343
18
- rda_python_common/pg_sig.py,sha256=gmOIHRx-SqiFmjQorQcJoEsiXoXI-akDrYoP3SuKVfM,62032
18
+ rda_python_common/pg_sig.py,sha256=S7FgYL87vo8xnL25E3-IHqo4p3Gv1jVrIbzoUM2IhAI,62155
19
19
  rda_python_common/pg_split.py,sha256=aAWKUZPmZ-LQ_fJ3DSKzPKxJw0fMDJ2fgP8ZT629M30,16375
20
20
  rda_python_common/pg_util.py,sha256=JL9NoW-VoQvsjXsUr09oBUWYJJNltU4GyQIfWlpkf90,86084
21
21
  rda_python_common/pgpassword.py,sha256=aTQaO59QokWrv2EKom4TvKhNW2Mr6aFMMBVG4DCbcKI,5023
22
22
  rda_python_common/pgpassword.usg,sha256=Wrle6A8sdlMGx3ZEAmE6TNDPOlG84Whe0T3rCNFzPfY,2013
23
- rda_python_common-3.0.31.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
- rda_python_common-3.0.31.dist-info/METADATA,sha256=MH_cd7VJNUJsx2lMUxE4MaKuwoRAVSbZb0kyywMbOYk,14530
25
- rda_python_common-3.0.31.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
- rda_python_common-3.0.31.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
- rda_python_common-3.0.31.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
- rda_python_common-3.0.31.dist-info/RECORD,,
23
+ rda_python_common-3.0.32.dist-info/licenses/LICENSE,sha256=1dck4EAQwv8QweDWCXDx-4Or0S8YwiCstaso_H57Pno,1097
24
+ rda_python_common-3.0.32.dist-info/METADATA,sha256=4g8--h9AH3tsSr7K-NENKxeC3IFkA11_zOniCZeoTCw,14530
25
+ rda_python_common-3.0.32.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
+ rda_python_common-3.0.32.dist-info/entry_points.txt,sha256=pZgVNWspcK-F1TbPav7C3C9NdeHDZMm_25fW9weix00,65
27
+ rda_python_common-3.0.32.dist-info/top_level.txt,sha256=KVQmx7D3DD-jsiheqL8HdTrRE14hpRnZY5_ioMArA5k,18
28
+ rda_python_common-3.0.32.dist-info/RECORD,,