コード例 #1
0
ファイル: __init__.py プロジェクト: idlesign/gwibber-yaru
    def __init__(self, acct):
        log.logger.debug('init')
        self.service = getbus("Service")

        if not acct.has_key("access_token"):
            raise exceptions.GwibberServiceError("keyring")
        self.account = acct

        pyyaru.ACCESS_TOKEN = acct["access_token"]
コード例 #2
0
ファイル: __init__.py プロジェクト: thnguyn2/ECE_527_MP
  def __init__(self, acct):
    self.service = util.getbus("Service")
    if acct.has_key("secret_token") and acct.has_key("password"): acct.pop("password")
    self.account = acct

    if not acct.has_key("access_token") and not acct.has_key("secret_token"):
      return [{"error": {"type": "auth", "account": self.account, "message": _("Failed to find credentials")}}]

    self.sigmethod = oauth.OAuthSignatureMethod_HMAC_SHA1()
    self.consumer = oauth.OAuthConsumer(*util.resources.get_twitter_keys())
    self.token = oauth.OAuthToken(acct["access_token"], acct["secret_token"])
コード例 #3
0
  def __init__(self, acct):
    self.service = util.getbus("Service")
    if acct.has_key("access_token") and acct.has_key("password"):
        acct.pop("password")
    self.account = acct


    if not acct.has_key("access_token"):
        return [{"error": {
                    "type": "auth",
                    "account": self.account,
                    "message": _("Failed to find credentials")
                 }}]

    self.token = acct["access_token"]
    log.logger.debug("init done")
コード例 #4
0
    def __init__(self, acct):
        self.service = util.getbus("Service")
        if acct.has_key("secret_token") and acct.has_key("password"):
            acct.pop("password")
        self.account = acct

        if not acct.has_key("access_token") and not acct.has_key(
                "secret_token"):
            return [{
                "error": {
                    "type": "auth",
                    "account": self.account,
                    "message": _("Failed to find credentials")
                }
            }]

        self.sigmethod = oauth.OAuthSignatureMethod_HMAC_SHA1()
        self.consumer = oauth.OAuthConsumer(*util.resources.get_twitter_keys())
        self.token = oauth.OAuthToken(acct["access_token"],
                                      acct["secret_token"])