def post(arguments):
twitter = api.API(arguments)<EOL>params = {}<EOL>if arguments.update == '<STR_LIT:->':<EOL><INDENT>params['<STR_LIT:status>'] = sys.stdin.read()<EOL><DEDENT>else:<EOL><INDENT>params['<STR_LIT:status>'] = arguments.update<EOL><DEDENT>if arguments.media_file:<EOL><INDENT>medias = [twitter.media_upload(m) for m in arguments.media_file]<EOL>params['<STR_LIT>'] = [m.media_id for m in medias]<EOL><DEDENT>try:<EOL><INDENT>logging.getLogger(arguments.screen_name).info('<STR_LIT>', params['<STR_LIT:status>'])<EOL>if not arguments.dry_run:<EOL><INDENT>twitter.update_status(**params)<EOL><DEDENT><DEDENT>except tweepy.TweepError as e:<EOL><INDENT>logging.getLogger(arguments.screen_name).error(e.message)<EOL><DEDENT>
Post text to a given twitter account.