def get_commit_text(config, auth): res = most_recent_commit(config=config) if res: commit, description = res try: url = get_commit_url(commit, config, auth) except: LOGGER.error("Couldn't get commit URL for '%s', '%s'", commit, description) raise return String.truncate_suffix(INTRO + description, url, Twitter.TWITTER_SIZE) else: LOGGER.error('Failed to git commit') return None
def post_update(text, auth, *names): text = String.truncate(text, TWITTER_SIZE) for name in names: get_api(auth, name).PostUpdate(text) return text