def init_httpclient(self):
        http = None

        keysfile = os.path.join(os.path.expanduser("~"),
                                ".httpshell", self.url.netloc + ".json")

        if os.path.isfile(keysfile):
            try:
                with open(keysfile, "r") as file:
                    keys = json.load(file)
                    token = None

                    consumer = oauth.Consumer(keys["consumer"]["consumer-key"],
                                              keys["consumer"]["consumer-secret"])
                    if "access" in keys:
                        token = oauth.Token(keys["access"]["access-token"],
                                            keys["access"]["access-token-secret"])

                    http = oauth.Client(consumer, token)
                    self.logger.print_text("Using OAuth config in " + keysfile)
            except:
                self.logger.print_error(
                    "Failed reading OAuth data from: " + keysfile)
        else:
            http = httplib2.Http()

        return http
dataset/ETHPy150Open chrislongo/HttpShell/httpshell/http.py/Http.init_httpclient/original