This note is composed from Igor's e-mail about Python module for posting message into ELog (from analysis releases).

Code location

  sit_setup
  addpkg LogBook V00-03-05 (or HEAD)
  scons

Modes of submission to ELog

First of all, one need to import the module and instantiate the 'poster':

from LogBook import message_poster
poster = message_poster.message_poster_self ( 'AMO', experiment='amodaq09' )
  1. Posting a new message w/o any attachments, tags, etc.:
      poster.post ( 'This is just a test' )
    
  2. Posting a message with one attachments:
      msg = 'This is just a test'
      attachments = ['/reg/neh/home1/gapon/AFS_HOME/public_html/NewOrgChart.pdf'] 
      poster.post ( msg, attachments=attachments )
    
  3. Multiple attachments:
      attachments = ['/reg/neh/home1/gapon/AFS_HOME/public_html/NewOrgChart.pdf', 'SomeOtherFile.jpg'] 
      poster.post ( msg, attachments=attachments )
    
  4. Tags and attachments:
      msg = ...
      attachments =  ...
      tags = ...
      poster.post ( msg, attachments=attachments, tags=tags )
    
  5. Posting a reply to an existing message. For that you need to get an identifier of that message. In the following example you first send a message. Then you obtain its identifier and pass to the reply:
     parent_message_id = poster.post ( 'The main thread for the discussion' )
     child_message_id = poster.post ( 'Here comes my reply', parent_message_id = parent_message_id )
    
  6. Posting a message for a specific run.

    For obvious reason this can't be combined with posting replies to existing messages:

      run_num = 123
      poster.post ( 'Go look for this message close to that run', run_num = run_num )
    
    Any reasonable combination of above parameters is possible.
  • No labels