Example #1
0
def run():
    sh = rmm.Shepherd('/home/charles/codes/tripos-bot/keys/',
                      sheep_class=PhotoADaySheep)

    sh.perform_action('photo_a_day', {
        'upload': True,
        'publish': True,
        'images_dir': 'latex'
    })
def run():
    # create a shepherd looking for 
    sh = rmm.Shepherd('keys/',sheep_class=rmm.QueneauSheep)

    # test that the Shepherd can get the flock of Sheep up and running.
    sh.perform_action('echo')

    # have all bots tweet in parallel
    sh.perform_pool_action('tweet',{'publish':False})
Example #3
0
def run():
    sh = rmm.Shepherd('keys/',
                      log_file='output.apollo.log',
                      sheep_class=rmm.QueneauSheep)

    # Test performing an action in series
    sh.perform_action('tweet', {'publish': False})

    # Test performing an action in parallel
    sh.perform_pool_action('tweet', {'publish': False})
Example #4
0
def set_img():
    """
    Running perform_action() with the change_image action
    requires each bot to have a change_image param set.
    
    The change_image action takes one parameter, 'image',
    which is the path to the image.
    
    Before we call perform_action(), we have to 
    set the 'image' attritube for each sheep.
    """
    sh = rmm.Shepherd('keys/', sheep_class=rmm.PoemSheep)

    for sheep in sh.all_sheep:
        poem_file = sheep.params['file']
        img_file = re.sub('poems', 'img', poem_file)
        img_file = re.sub('txt', 'jpg', img_file)
        sheep.params['image'] = img_file
def run():
    sh = rmm.Shepherd('keys/', sheep_class=rmm.QueneauSheep)
    sh.perform_action('tweet', {'publish': False})
Example #6
0
def tweet():
    sh = rmm.Shepherd('keys/', sheep_class=rmm.PoemSheep)
    sh.perform_pool_action('tweet', {'publish': False})