wwpdb.apps.msgmodule 0.180.2__tar.gz → 0.181__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 (43) hide show
  1. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/PKG-INFO +1 -1
  2. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/__init__.py +1 -1
  3. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/DataAccessLayer.py +18 -13
  4. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/depict/MessagingTemplates.py +6 -8
  5. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/MessagingIo.py +24 -24
  6. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/ExtractMessage.py +7 -3
  7. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/PKG-INFO +1 -1
  8. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/README.md +0 -0
  9. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/setup.cfg +0 -0
  10. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/setup.py +0 -0
  11. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/__init__.py +0 -0
  12. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/__init__.py +0 -0
  13. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/LockFile.py +0 -0
  14. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/MessagingDataExport.py +0 -0
  15. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/MessagingDataImport.py +0 -0
  16. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/Models.py +0 -0
  17. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/PdbxMessage.py +0 -0
  18. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/PdbxMessageIo.py +0 -0
  19. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/db/__init__.py +0 -0
  20. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/depict/MessagingDepict.py +0 -0
  21. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/depict/__init__.py +0 -0
  22. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/CompatIo.py +0 -0
  23. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/DateUtil.py +0 -0
  24. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/EmHeaderUtils.py +0 -0
  25. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/MessagingDataExport.py +0 -0
  26. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/MessagingDataImport.py +0 -0
  27. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/io/__init__.py +0 -0
  28. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/models/Message.py +0 -0
  29. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/models/__init__.py +0 -0
  30. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/AutoMessage.py +0 -0
  31. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/DaInternalDb.py +0 -0
  32. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/MessagingDataRouter.py +0 -0
  33. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/__init__.py +0 -0
  34. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/dump_db_to_cif.py +0 -0
  35. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/util/list_recent_messages.py +0 -0
  36. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/webapp/MessagingWebApp.py +0 -0
  37. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/webapp/__init__.py +0 -0
  38. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb/apps/msgmodule/webapp/wsgi.py +0 -0
  39. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/SOURCES.txt +0 -0
  40. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/dependency_links.txt +0 -0
  41. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/not-zip-safe +0 -0
  42. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/requires.txt +0 -0
  43. {wwpdb_apps_msgmodule-0.180.2 → wwpdb_apps_msgmodule-0.181}/wwpdb.apps.msgmodule.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wwpdb.apps.msgmodule
3
- Version: 0.180.2
3
+ Version: 0.181
4
4
  Summary: wwPDB messaging module
5
5
  Home-page: https://github.com/rcsb/py-wwpdb_apps_ann_tasks_v2
6
6
  Author: Ezra Peisach
@@ -2,4 +2,4 @@ __docformat__ = "restructuredtext en"
2
2
  __author__ = "Ezra Peisach"
3
3
  __email__ = "ezra.peisach@rcsb.org"
4
4
  __license__ = "Apache 2.0"
5
- __version__ = "0.180.2"
5
+ __version__ = "0.181"
@@ -81,14 +81,18 @@ def _get_or_create_engine(db_config: Dict):
81
81
  echo=False # Set to True for SQL debugging
82
82
  )
83
83
 
84
- # Test connection and set max_allowed_packet for large messages
84
+ # Test connection
85
+ # NOTE: Disabled SET SESSION max_allowed_packet due to permission restrictions in production.
86
+ # Production database users typically lack SUPER privilege required for session-level settings.
87
+ # The application relies on the server's GLOBAL max_allowed_packet setting configured by the DBA.
88
+ # If large message inserts fail due to packet size, the DBA must increase GLOBAL max_allowed_packet.
85
89
  with engine.connect() as conn:
86
90
  conn.execute(text("SELECT 1"))
87
- try:
88
- conn.execute(text("SET SESSION max_allowed_packet=67108864"))
89
- logger.info("Set SESSION max_allowed_packet to 64MB for large messages")
90
- except Exception as e:
91
- logger.warning(f"Could not set max_allowed_packet (may require SUPER privilege): {e}") # pylint: disable=logging-fstring-interpolation
91
+ # try:
92
+ # conn.execute(text("SET SESSION max_allowed_packet=67108864"))
93
+ # logger.info("Set SESSION max_allowed_packet to 64MB for large messages")
94
+ # except Exception as e:
95
+ # logger.warning(f"Could not set max_allowed_packet (may require SUPER privilege): {e}") # pylint: disable=logging-fstring-interpolation
92
96
 
93
97
  logger.info("Database connection test successful")
94
98
 
@@ -236,18 +240,19 @@ class BaseDAO(Generic[ModelType]):
236
240
  Returns:
237
241
  bool: True if creation succeeded, False otherwise
238
242
 
239
- Note:
240
- Automatically sets SESSION max_allowed_packet to 64MB for large messages
241
243
  """
242
244
  max_retries = 3
243
245
  for attempt in range(max_retries):
244
246
  try:
245
247
  with self.db_connection.get_session() as session:
246
- # Ensure max_allowed_packet is set for this session
247
- try:
248
- session.execute(text("SET SESSION max_allowed_packet=67108864"))
249
- except Exception:
250
- pass # Ignore if we can't set it
248
+ # NOTE: SET SESSION max_allowed_packet is disabled due to permission restrictions.
249
+ # Production database users lack SUPER privilege. The application relies on the server's
250
+ # GLOBAL max_allowed_packet setting. If inserts fail due to packet size, the DBA must
251
+ # increase the global setting via: SET GLOBAL max_allowed_packet=...
252
+ # try:
253
+ # session.execute(text("SET SESSION max_allowed_packet=67108864"))
254
+ # except Exception:
255
+ # pass # Ignore if we can't set it
251
256
 
252
257
  session.add(obj)
253
258
  session.commit()
@@ -68,16 +68,14 @@ Twitter: http://twitter.com/#!/buildmodels
68
68
 
69
69
  msgTmplt_site_contact_details_pdbe = """
70
70
  --------------------------------------------------------------------------------------------------------------
71
- Protein Data Bank in Europe (PDBe), a wwPDB partner site
72
- http://www.PDBe.org
73
-
71
+ Protein Data Bank in Europe (PDBe) and Electron Microscopy Data Bank (EMDB), wwPDB partner sites
72
+ https://www.PDBe.org | https://www.emdatabank.org
74
73
  EMBL's European Bioinformatics Institute
75
74
  Wellcome Trust Genome Campus
76
- Hinxton
77
- Cambridge CB10 1SD UK
78
-
79
- http://www.facebook.com/proteindatabank
80
- http://twitter.com/PDBeurope
75
+ Hinxton, Cambridge, CB10 1SD, UK
76
+ https://www.linkedin.com/company/pdbe/ | https://www.linkedin.com/company/emdatabank/
77
+ https://bsky.app/profile/pdbeurope.bsky.social | https://bsky.app/profile/emdatabank.bsky.social
78
+ https://x.com/PDBeurope | https://x.com/EMDB_EMPIAR
81
79
  --------------------------------------------------------------------------------------------------------------"""
82
80
 
83
81
  msgTmplt_site_contact_details_pdbj = """
@@ -491,7 +491,7 @@ class MessagingIo(object):
491
491
 
492
492
  # For database-backed storage (dummy paths), skip file existence checks
493
493
  if self.__msgsFrmDpstrFilePath is not None and (self.__msgsFrmDpstrFilePath.startswith("/dummy") or os.access(self.__msgsFrmDpstrFilePath, os.R_OK)):
494
- pdbxMsgIo_frmDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
494
+ pdbxMsgIo_frmDpstr = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
495
495
  try:
496
496
  depId = str(self.__reqObj.getValue("identifier"))
497
497
  ok = pdbxMsgIo_frmDpstr.read(self.__msgsFrmDpstrFilePath, deposition_id=depId)
@@ -504,7 +504,7 @@ class MessagingIo(object):
504
504
  pdbxMsgIo_frmDpstr.close() # Explicitly close to release database connections # pylint: disable=no-member
505
505
 
506
506
  if self.__msgsToDpstrFilePath is not None and (self.__msgsToDpstrFilePath.startswith("/dummy") or os.access(self.__msgsToDpstrFilePath, os.R_OK)):
507
- pdbxMsgIo_toDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
507
+ pdbxMsgIo_toDpstr = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
508
508
  try:
509
509
  depId = str(self.__reqObj.getValue("identifier"))
510
510
  ok = pdbxMsgIo_toDpstr.read(self.__msgsToDpstrFilePath, deposition_id=depId)
@@ -521,7 +521,7 @@ class MessagingIo(object):
521
521
 
522
522
  # For database-backed storage (dummy paths), skip file existence checks
523
523
  if self.__notesFilePath is not None and (self.__notesFilePath.startswith("/dummy") or os.access(self.__notesFilePath, os.R_OK)):
524
- pdbxMsgIo_notes = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
524
+ pdbxMsgIo_notes = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
525
525
  try:
526
526
  depId = str(self.__reqObj.getValue("identifier"))
527
527
  ok = pdbxMsgIo_notes.read(self.__notesFilePath, deposition_id=depId)
@@ -622,7 +622,7 @@ class MessagingIo(object):
622
622
 
623
623
  # For database-backed storage (dummy paths), skip file existence checks
624
624
  if self.__msgsFrmDpstrFilePath is not None and (self.__msgsFrmDpstrFilePath.startswith("/dummy") or os.access(self.__msgsFrmDpstrFilePath, os.R_OK)):
625
- pdbxMsgIo_frmDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
625
+ pdbxMsgIo_frmDpstr = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
626
626
  depId = str(self.__reqObj.getValue("identifier"))
627
627
  ok = pdbxMsgIo_frmDpstr.read(self.__msgsFrmDpstrFilePath, deposition_id=depId)
628
628
  if ok:
@@ -634,7 +634,7 @@ class MessagingIo(object):
634
634
  origCommsLst.extend(pdbxMsgIo_frmDpstr.getOrigCommReferenceInfo())
635
635
 
636
636
  if self.__msgsToDpstrFilePath is not None and (self.__msgsToDpstrFilePath.startswith("/dummy") or os.access(self.__msgsToDpstrFilePath, os.R_OK)):
637
- pdbxMsgIo_toDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
637
+ pdbxMsgIo_toDpstr = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
638
638
  depId = str(self.__reqObj.getValue("identifier"))
639
639
  ok = pdbxMsgIo_toDpstr.read(self.__msgsToDpstrFilePath, deposition_id=depId)
640
640
  if ok:
@@ -659,7 +659,7 @@ class MessagingIo(object):
659
659
 
660
660
  # For database-backed storage (dummy paths), skip file existence checks
661
661
  if self.__notesFilePath is not None and (self.__notesFilePath.startswith("/dummy") or os.access(self.__notesFilePath, os.R_OK)):
662
- pdbxMsgIo_notes = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
662
+ pdbxMsgIo_notes = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
663
663
  depId = str(self.__reqObj.getValue("identifier"))
664
664
  ok = pdbxMsgIo_notes.read(self.__notesFilePath, deposition_id=depId)
665
665
 
@@ -870,7 +870,7 @@ class MessagingIo(object):
870
870
 
871
871
  # For database-backed storage (dummy paths), skip file existence checks
872
872
  if self.__msgsFrmDpstrFilePath is not None and (self.__msgsFrmDpstrFilePath.startswith("/dummy") or os.access(self.__msgsFrmDpstrFilePath, os.R_OK)):
873
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
873
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
874
874
  with LockFile(
875
875
  self.__msgsFrmDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
876
876
  ) as _lf, FileSizeLogger(self.__msgsFrmDpstrFilePath, verbose=self.__verbose, log=self.__lfh) as _fsl:
@@ -882,7 +882,7 @@ class MessagingIo(object):
882
882
 
883
883
  # For database-backed storage (dummy paths), skip file existence checks
884
884
  if self.__msgsToDpstrFilePath is not None and (self.__msgsToDpstrFilePath.startswith("/dummy") or os.access(self.__msgsToDpstrFilePath, os.R_OK)):
885
- mIIo2 = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
885
+ mIIo2 = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
886
886
  with LockFile(
887
887
  self.__msgsToDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
888
888
  ) as _lf, FileSizeLogger( # noqa: F841
@@ -962,7 +962,7 @@ class MessagingIo(object):
962
962
 
963
963
  # For database-backed storage (dummy paths), skip file existence checks
964
964
  if self.__notesFilePath is not None and (self.__notesFilePath.startswith("/dummy") or os.access(self.__notesFilePath, os.R_OK)):
965
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
965
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
966
966
  with LockFile(
967
967
  self.__notesFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
968
968
  ) as _lf, FileSizeLogger( # noqa: F841
@@ -1044,7 +1044,7 @@ class MessagingIo(object):
1044
1044
  else:
1045
1045
  logger.info("Using database storage - skipping file operations for: %s", outputFilePth)
1046
1046
  #
1047
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
1047
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
1048
1048
  with LockFile(outputFilePth, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh) as _lf, FileSizeLogger(
1049
1049
  outputFilePth, verbose=self.__verbose, log=self.__lfh
1050
1050
  ) as _fsl: # noqa: F841
@@ -1437,10 +1437,10 @@ class MessagingIo(object):
1437
1437
  elif p_tmpltType == "remind-unlocked":
1438
1438
  msgTmplt = MessagingTemplates.msgTmplt_remindUnlocked
1439
1439
  attachFiles = False
1440
- isNote = True
1440
+ # isNote = True
1441
1441
  # Need all ids
1442
1442
  accstr = templateDict["accession_ids"]
1443
- subject = "ARCHIVED: Please attend to your unlocked deposition session - " + accstr
1443
+ subject = "Please attend to your unlocked deposition session - " + accstr
1444
1444
  elif p_tmpltType == "approval-impl": # CS 2024-04-04 change implicit-approved to approval-impl to match frontend drop-down
1445
1445
  msgTmplt = MessagingTemplates.msgTmplt_approvalImplicit_em if p_isEmdbEntry else MessagingTemplates.msgTmplt_approvalImplicit
1446
1446
  attachFiles = False
@@ -1468,14 +1468,14 @@ class MessagingIo(object):
1468
1468
  elif p_tmpltType == "reminder": # CS 2024-04-04 change type from remind-feedback to reminder to match frontend drop-down
1469
1469
  msgTmplt = MessagingTemplates.msgTmplt_reminder_em if p_isEmdbEntry else MessagingTemplates.msgTmplt_reminder
1470
1470
  attachFiles = False
1471
- isNote = True
1471
+ # isNote = True
1472
1472
  # Need all ids
1473
1473
  accstr = templateDict["accession_ids"]
1474
1474
  subject = "REMINDER: Still awaiting feedback for " + accstr
1475
1475
  elif p_tmpltType == "reminder-auth-to-rel": # CS 2024-09-09 add process to send reminder on AUTH entry deposited as REL
1476
1476
  msgTmplt = MessagingTemplates.msgTmplt_reminder_auth_to_rel_em if p_isEmdbEntry else MessagingTemplates.msgTmplt_reminder_auth_to_rel
1477
1477
  attachFiles = False
1478
- isNote = True
1478
+ # isNote = True
1479
1479
  accstr = templateDict["accession_ids"]
1480
1480
  subject = "REMINDER: Upcoming release of " + accstr
1481
1481
  else:
@@ -1581,8 +1581,8 @@ class MessagingIo(object):
1581
1581
  # No files are being attached
1582
1582
  fileRefList = []
1583
1583
 
1584
- # We are archiving notes
1585
- isNote = True
1584
+ # We are archiving notes -- not any more 3/30/26
1585
+ isNote = False
1586
1586
 
1587
1587
  contextType = p_tmpltType # CS 2024-04-04 record message type, following frontend message-to-depositor drop-down list, default at "other"
1588
1588
  contextVal = None
@@ -1654,7 +1654,7 @@ class MessagingIo(object):
1654
1654
  msgDI = MessagingDataImport(self.__reqObj, verbose=self.__verbose, log=self.__lfh)
1655
1655
  self.__msgsFrmDpstrFilePath = msgDI.getFilePath(contentType="messages-from-depositor", format="pdbx")
1656
1656
  logger.info("self.__msgsFromDpstrFilePath is: %s", self.__msgsFrmDpstrFilePath)
1657
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
1657
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
1658
1658
  with LockFile(
1659
1659
  self.__msgsFrmDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
1660
1660
  ) as _lf, FileSizeLogger( # noqa: F841
@@ -1726,7 +1726,7 @@ class MessagingIo(object):
1726
1726
  except IOError:
1727
1727
  pass
1728
1728
  #
1729
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
1729
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
1730
1730
  with LockFile(
1731
1731
  self.__msgsToDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
1732
1732
  ) as _lf, FileSizeLogger(
@@ -1850,7 +1850,7 @@ class MessagingIo(object):
1850
1850
 
1851
1851
  # For database-backed storage (dummy paths), skip file existence checks
1852
1852
  if self.__notesFilePath is not None and (self.__notesFilePath.startswith("/dummy") or os.access(self.__notesFilePath, os.R_OK)):
1853
- pdbxMsgIo_notes = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
1853
+ pdbxMsgIo_notes = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
1854
1854
  depId = str(self.__reqObj.getValue("identifier"))
1855
1855
  bGotContent = pdbxMsgIo_notes.read(self.__notesFilePath, deposition_id=depId)
1856
1856
 
@@ -1927,7 +1927,7 @@ class MessagingIo(object):
1927
1927
  except IOError:
1928
1928
  pass
1929
1929
  #
1930
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
1930
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
1931
1931
  msgAlreadySeen = False
1932
1932
  with LockFile(
1933
1933
  self.__msgsToDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
@@ -2002,8 +2002,8 @@ class MessagingIo(object):
2002
2002
  msgsFrmDpstrLst = []
2003
2003
  msgStatusLst = []
2004
2004
  fileSizeToDpstr = 0
2005
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
2006
- mIIo2 = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
2005
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
2006
+ mIIo2 = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
2007
2007
 
2008
2008
  try:
2009
2009
  # GET LIST OF IDS OF MSGS FROM DEPOSITOR
@@ -2152,7 +2152,7 @@ class MessagingIo(object):
2152
2152
  if self.__msgsToDpstrFilePath and (self.__msgsToDpstrFilePath.startswith("/dummy") or os.access(self.__msgsToDpstrFilePath, os.R_OK)):
2153
2153
  fileSizeBytes = self.__getFileSizeBytes(self.__msgsToDpstrFilePath) if not self.__msgsToDpstrFilePath.startswith("/dummy") else 1
2154
2154
  if fileSizeBytes > 0:
2155
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
2155
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
2156
2156
  with LockFile(
2157
2157
  self.__msgsToDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
2158
2158
  ) as _lf, FileSizeLogger( # noqa: F841
@@ -2993,7 +2993,7 @@ class MessagingIo(object):
2993
2993
  logger.info("self.__msgsToDpstrFilePath is: %s", self.__msgsToDpstrFilePath)
2994
2994
 
2995
2995
  if self.__msgsToDpstrFilePath is not None and os.access(self.__msgsToDpstrFilePath, os.R_OK):
2996
- mIIo = PdbxMessageIo(verbose=self.__verbose, log=self.__lfh)
2996
+ mIIo = PdbxMessageIo(site_id=self.__siteId, verbose=self.__verbose, log=self.__lfh)
2997
2997
  with LockFile(
2998
2998
  self.__msgsToDpstrFilePath, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__lfh
2999
2999
  ) as _lf, FileSizeLogger( # noqa: F841
@@ -114,7 +114,9 @@ class ExtractMessage(object):
114
114
  logger.info("read message file for %s at %s", depid, filepath_msg)
115
115
 
116
116
  try:
117
- pdbxMsgIo = PdbxMessageIo(verbose=self.__verbose, log=self.__log)
117
+ # Pass site_id explicitly to keep DB/file routing deterministic.
118
+ siteId = self.__siteId if self.__siteId is not None else getSiteId()
119
+ pdbxMsgIo = PdbxMessageIo(site_id=siteId, verbose=self.__verbose, log=self.__log)
118
120
  with LockFile(filepath_msg, timeoutSeconds=self.__timeoutSeconds, retrySeconds=self.__retrySeconds, verbose=self.__verbose, log=self.__log):
119
121
  ok = pdbxMsgIo.read(filepath_msg, deposition_id=depid)
120
122
  if ok:
@@ -695,7 +697,9 @@ class ExtractMessage(object):
695
697
  dep_fpath = self.__getMsgFilePath(depid, "messages-from-depositor", test_folder=None)
696
698
  bio_fpath = self.__getMsgFilePath(depid, "messages-to-depositor", test_folder=None)
697
699
 
698
- pdbxMsgIo_frmDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__log)
700
+ # Reuse one resolved site_id for both reads so they follow the same backend.
701
+ siteId = self.__siteId if self.__siteId is not None else getSiteId()
702
+ pdbxMsgIo_frmDpstr = PdbxMessageIo(site_id=siteId, verbose=self.__verbose, log=self.__log)
699
703
  ok = pdbxMsgIo_frmDpstr.read(dep_fpath, deposition_id=depid)
700
704
  if not ok:
701
705
  return []
@@ -704,7 +708,7 @@ class ExtractMessage(object):
704
708
  pdbxMsgIo_frmDpstr.getMessageInfo()
705
709
  ) # in recordSetLst we now have a list of dictionaries with item names as keys and respective data for values
706
710
 
707
- pdbxMsgIo_toDpstr = PdbxMessageIo(verbose=self.__verbose, log=self.__log)
711
+ pdbxMsgIo_toDpstr = PdbxMessageIo(site_id=siteId, verbose=self.__verbose, log=self.__log)
708
712
  ok = pdbxMsgIo_toDpstr.read(bio_fpath, deposition_id=depid)
709
713
  if not ok:
710
714
  # Assume all messages unacknowledged
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wwpdb.apps.msgmodule
3
- Version: 0.180.2
3
+ Version: 0.181
4
4
  Summary: wwPDB messaging module
5
5
  Home-page: https://github.com/rcsb/py-wwpdb_apps_ann_tasks_v2
6
6
  Author: Ezra Peisach