You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

Here is how you can get the one from your analysis release:

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

And here is how to use it for various scenarios. First of all you 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. NOTE: 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 )

As you can imagine all combinations are possible combinations of those.

  • No labels