Page History
Table of Contents |
---|
This note is composed from Igor's e-mail about Python module for posting message into ELog (from analysis releases).
Code location
Code Block |
---|
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':
Code Block |
---|
from LogBook import message_poster poster = message_poster.message_poster_self ( 'AMO', experiment='amodaq09' ) |
- Posting a new message w/o any attachments, tags, etc.:
Code Block poster.post ( 'This is just a test' )
- Posting a message with one attachments:
Code Block msg = 'This is just a test' attachments = ['/reg/neh/home1/gapon/AFS_HOME/public_html/NewOrgChart.pdf'] poster.post ( msg, attachments=attachments )
- Multiple attachments:
Code Block attachments = ['/reg/neh/home1/gapon/AFS_HOME/public_html/NewOrgChart.pdf', 'SomeOtherFile.jpg'] poster.post ( msg, attachments=attachments )
- Tags and attachments:
Code Block msg = ... attachments = ... tags = ... poster.post ( msg, attachments=attachments, tags=tags )
- 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:
Code Block 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 )
- Posting a message for a specific run.
Note For obvious reason this can't be combined with posting replies to existing messages:
Any reasonable combination of above parameters is possible.Code Block run_num = 123 poster.post ( 'Go look for this message close to that run', run_num = run_num )
Overview
Content Tools