for conf in config.CHANNELS.values() if "IDENTICA" in conf ] except (ImportError, KeyError) as e: logerr( "Could not find `gazouilleur/identica_auth_config.py` with configuration for %s.\nERROR: Please run `python bin/auth_identica.py` to generate your OAuth Identi.ca keys and create it automatically.\n" % e) exit(1) from gazouilleur.lib.microblog import Microblog for chan, conf in config.CHANNELS.iteritems(): if "IDENTICA" not in conf: continue conn = Microblog("identica", conf) try: from urllib2 import urlopen urlopen("https://identi.ca", timeout=15) if not conn.ping(): logerr( "Cannot connect to Identi.ca with the auth configuration provided in `gazouilleur/identica_auth_config.py` for channel %s and user @%s.\nERROR: Please rerun `python bin/auth_identica.py` to generate your OAuth Identi.ca keys.\n" % (chan, conf["IDENTICA"]["USER"].lower())) exit(1) except: stderr.write( colorize( "WARNING: Identi.ca seems down, bypassing related tests.\n", 'red', style='bold')) # Check Twitter config for chan, conf in config.CHANNELS.iteritems(): if "TWITTER" not in conf: continue
if [1 for c in config.CHANNELS.values() if "IDENTICA" in c]: try: from gazouilleur.identica_auth_config import identica_auth [identica_auth[conf['IDENTICA']['USER'].lower()] for conf in config.CHANNELS.values() if "IDENTICA" in conf] except (ImportError, KeyError) as e: logerr("Could not find `gazouilleur/identica_auth_config.py` with configuration for %s.\nERROR: Please run `python bin/auth_identica.py` to generate your OAuth Identi.ca keys and create it automatically.\n" % e) exit(1) from gazouilleur.lib.microblog import Microblog for chan, conf in config.CHANNELS.iteritems(): if "IDENTICA" not in conf: continue conn = Microblog("identica", conf) try: from urllib2 import urlopen urlopen("https://identi.ca", timeout=15) if not conn.ping(): logerr("Cannot connect to Identi.ca with the auth configuration provided in `gazouilleur/identica_auth_config.py` for channel %s and user @%s.\nERROR: Please rerun `python bin/auth_identica.py` to generate your OAuth Identi.ca keys.\n" % (chan, conf["IDENTICA"]["USER"].lower())) exit(1) except: stderr.write(colorize("WARNING: Identi.ca seems down, bypassing related tests.\n", 'red', style='bold')) # Check Twitter config for chan, conf in config.CHANNELS.iteritems(): if "TWITTER" not in conf: continue conn = Microblog("twitter", conf) if not conn.ping(): logerr("Cannot connect to Twitter with the auth configuration provided in `gazouilleur/config.py` for channel %s and user @%s.\nERROR: Please check you properly set the 4 auth fields and gave \"Read, write, and direct messages\" rights to gazouilleur's app on https://dev.twitter.com and wait at most 15 minutes\n" % (chan, conf["TWITTER"]["USER"])) exit(1) # Check IRC server