Exemplo n.º 1
0
 def __init__(self,clientname,platformname):
     t1=configparser()
     self.logger_test=loggermodule()
     self.client_name,consumer_key,consumer_secret,access_token_key,access_token_secret=t1.configparse(clientname,platformname)
     auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
     auth.set_access_token(access_token_key, access_token_secret)
     try:
       self.api = tweepy.API(auth)
       self.logger_test.info("succesful authentication with twitter")
     except Exception,e:
         self.logger_test.exception("error occured while doing authentication with twitter with following error:%s"%str(e))
         sys.exit("authentication failed")
Exemplo n.º 2
0
 def __init__(self, clientname, platformname, user, repo):
     #ACCESS_TOKEN="dce09ea4b555192cd85f2a7e6c3d7aa7f1e7703b"
     t1 = configparser()
     self.clientname, self.access_token = t1.configparse(
         clientname, platformname)
     USER = "******" % user
     REPO = "%s" % repo
     self.logger_test = loggermodule()
     print "self.access_token", self.access_token
     self.g = Github(self.access_token, per_page=100)
     #print self.g
     self.user = self.g.get_user(USER)
     self.repo = self.user.get_repo(REPO)
Exemplo n.º 3
0
        except:
            k = stargazers
        self.logger_test.info("Total number of repo of the user:%s" %
                              len(repos_apache))
        self.logger_test.info("Different languages used in the repo:%s" % lang)
        self.logger_test.info("Top contributors:%s" % k)
        f.write("Total number of repo of the user:%s\n" % len(repos_apache))
        f.write("Different languages used in the repo:%s\n" % lang)
        f.write("Total no. of languages used in repo:%s\n" % len(lang))
        f.write("Top contributors:%s\n" % k)

        return len(repos_apache), lang, len(lang), k


if __name__ == "__main__":
    loggerdata = loggermodule()
    parser = optparse.OptionParser(description='Optional app description')
    parser.add_option(
        '-u',
        '--username',
        help=
        'enter the username for which you have access token,consumer_token etc.'
    )
    parser.add_option(
        '-p',
        '--platformname',
        help=
        'enter the platform for which you have access token,consumer_token etc.',
        default="github")
    parser.add_option('-g',
                      '--repousername',
Exemplo n.º 4
0
 def __init__(self):
     self.logger_test = loggermodule()
     self.logger_test.debug("initialising constructor")
     print "i am printing something", self.logger_test