<s> __appname__ = '<STR_LIT>' <EOL> __version__ = "<STR_LIT>" <EOL> __author__ = "<STR_LIT>" <EOL> __licence__ = "<STR_LIT>" <EOL> import tweepy <EOL> from git import Repo <EOL> from config import keys <EOL> from colorama import Fore , Style <EOL> git_path = '<STR_LIT>' <EOL> def twitter_authorize ( ) : <EOL> """<STR_LIT>""" <EOL> auth = tweepy . OAuthHandler ( keys [ '<STR_LIT>' ] , keys [ '<STR_LIT>' ] ) <EOL> auth . set_access_token ( keys [ '<STR_LIT>' ] , keys [ '<STR_LIT>' ] ) <EOL> api = tweepy . API ( auth ) <EOL> return api <EOL> def tweet_commit ( ) : <EOL> repo = Repo ( git_path ) <EOL> assert repo . bare == False <EOL> repo . config_reader ( ) <EOL> last_commit = repo . head . commit . message . strip ( "<STR_LIT:\n>" ) <EOL> api = twitter_authorize ( ) <EOL> tweet = "<STR_LIT>" + last_commit + "<STR_LIT>" <EOL> try : <EOL> api . update_status ( tweet ) <EOL> print "<STR_LIT>" <EOL> except tweepy . TweepError as error : <EOL> print ( "<STR_LIT>" + Fore . RED + "<STR_LIT:%s>" % error + Fore . RESET ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> tweet_commit ( ) </s>
