PYME.Acquire.htsms.tweeter module

class PYME.Acquire.htsms.tweeter.FakeAPI

Bases: object

update_status(status)
class PYME.Acquire.htsms.tweeter.LazyScopeTweeter(action_queue, credential_filepath=None, prepend_text='', sleep_time=60, safety=True)

Bases: object

Something to run in the background and send automated tweets based on actions queued. Could easily use dispatch to listen for the onQueueChanged signal from the action_manager, which would be worthwhile if we are adding queue items we want to track/tweet in real time, but this is such low priority that building in longer delays seems appropriate

property actions
add_tweet_condition(condition)
Parameters
condition: dict
following keys:
queue_condition: int

Number of tasks required to make this condition live, e.g. 10000 If we want to tweet after 10,000 cells have been imaged

queue_above: int

1: queue when count is above queue_condition, 0: queue when count is equal to queue_condition, -1: queue when count is below queue_condition

trigger_counts: int

number of counts

trigger_above: int

1: trigger when count is above trigger_counts, 0: trigger when count is equal to trigger_counts, -1: trigger when count is below trigger_counts

action_filter: str

Type of task to count, e.g. ‘spoolController.start_spooling’. A null string, ‘’, will count all tasks.

message: str

Message to tweet once triggered

recurring: bool

Flag to recycle this condition after it is met and the tweet is sent FIXME- not implemented yet

Returns
None
scope_tweet(text)
start_poll()
update()

Note that by being lazy, we can potentially miss some tweets, e.g. those which become “live” and then the condition is no longer met by the time we get to it here

Returns