def __init__(self, db_name, config, log_root_path): """ :type db_name: str :param db_name: the name of the DB to initialize/connect to, it cannot be null and must follow the format allowed in MySQL (http://dev.mysql.com/doc/refman/5.7/en/identifiers.html). If a DB having a name equal already exists in Gitana, the existing DB will be dropped and a new one will be created :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._db_name = db_name self._config = config self._log_root_path = log_root_path self._db_util = DbUtil() self._logging_util = LoggingUtil() log_path = self._log_root_path + "db-schema-" + db_name self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") self._cnx = self._db_util.get_connection(self._config)
def __init__(self, db_name, config, log_root_path): """ :type db_name: str :param config: name of an existing DB :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._dsl_util = DslUtil() self._date_util = DateUtil() self._db_util = DbUtil() self._logging_util = LoggingUtil() self._log_path = log_root_path + "export-activity-report-" + db_name self._logger = self._logging_util.get_logger(self._log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, self._log_path, "info") self._db_name = db_name self._config = config self._cnx = self._db_util.get_connection(self._config) self._db_util.set_database(self._cnx, self._db_name) self._db_util.set_settings(self._cnx) self._chart_generator = ChartGenerator(self._cnx, self._logger) self._html_generator = HtmlGenerator(self._logger)
def __init__(self, db_name, forum_id, interval, token, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type forum_id: int :param forum_id: the id of an existing forum in the DB :type interval: list int :param interval: a list of topic ids to import :type token: str :param token: a Stackoverflow token :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._interval = interval self._db_name = db_name self._forum_id = forum_id self._token = token self._config = config self._logging_util = LoggingUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None
def __init__(self, db_name, instant_messaging_id, interval, token, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type instant_messaging_id: int :param instant_messaging_id: the id of an existing instant messaging in the DB :type interval: list int :param interval: a list of channel ids to import :type token: str :param token: a Slack token :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._interval = interval self._db_name = db_name self._instant_messaging_id = instant_messaging_id self._token = token self._config = config self._logging_util = LoggingUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None
def __init__(self, config, db_name, log_root_path): """ :type config: dict :param config: the DB configuration file :type db_name: str :param config: name of an existing DB :type log_root_path: str :param log_root_path: the log path """ self._db_util = DbUtil() self._dsl_util = DslUtil() self._logging_util = LoggingUtil() self._log_path = log_root_path + "export-graph-" + db_name + ".log" self._logger = self._logging_util.get_logger(self._log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, self._log_path, "info") self._db_name = db_name self._config = config self._cnx = self._db_util.get_connection(self._config) self._db_util.set_database(self._cnx, self._db_name) self._db_util.set_settings(self._cnx)
def __init__(self, config, db_name, project_name, repo_name, log_path): """ initializer :param config: mysql database config dict :type config: dict :param db_name: mysql database name :type db_name: str :type project_name: str :param project_name: the name of an existing project in the DB :param repo_name: git repo name :type repo_name: str :type log_path: str :param log_path: the log path """ self._config = config self._project_name = project_name self._repo_name = repo_name # set database key-val pair in config dict self._config['database'] = db_name self._logging_util = LoggingUtil() log_path = log_path + "extract-relations-" + db_name + ".log" self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info")
def __init__(self): log_file = "{}.log".format(self.__class__.__name__.lower()) LoggingUtil.setup(log_path=log_file, log_level=logging.DEBUG) self._logger = logging.getLogger(self.__class__.__name__) self._stopped = False self._console = Console(self._on_command_event) self._server_sock = ServerSocket(self.COMMAND_PORT, self._on_socket_accept_event)
def __init__(self, db_name, project_name, repo_name, git_repo_path, before_date, import_type, references, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of the Git repository to import :type git_repo_path: str :param git_repo_path: the local path of the Git repository :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type import_type: int :param import_type: 1 does not import patches, 2 imports patches but not at line level, 3 imports patches with line detail :type references: list str :param references: list of references to import :type num_processes: int :param num_processes: number of processes to import the data (default 5) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-git-" + db_name + "-" + project_name + "-" + repo_name self._git_repo_path = git_repo_path self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._before_date = before_date self._import_type = import_type self._references = references if num_processes: self._num_processes = num_processes else: self._num_processes = Git2DbMain.NUM_PROCESSES config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __init__(self, db_name, project_name, repo_name, git_repo_path, import_type, extensions, references, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of the Git repository to import :type git_repo_path: str :param git_repo_path: the local path of the Git repository :type import_type: int :param import_type: 1 = import overall function statistics per file, 2 = import function-level information :type extensions: list str :param extensions: file extensions to analyse. Gitana calculates loc, comments and blank lines for most of the files. For the following languages ['java', 'py', 'php', 'scala', 'js', 'rb', 'cs', 'cpp', 'c'], Gitana also provides insights about ccn, functions and tokens. :type references: list str :param references: list of references to analyse :type num_processes: int :param num_processes: number of processes to import the data (default 10) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-code-" + db_name + "-" + project_name + "-" + repo_name self._git_repo_path = git_repo_path self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._import_type = import_type self._extensions = extensions self._references = references if num_processes: self._num_processes = num_processes else: self._num_processes = Code2DbMain.NUM_PROCESSES config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __init__(self, db_name, project_name, repo_name, type, issue_tracker_name, url, before_date, tokens, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of an existing repository in the DB :type type: str :param type: type of the issue tracker (Bugzilla, GitHub) :type issue_tracker_name: str :param issue_tracker_name: the name of the issue tracker to import :type url: str :param url: full name of the GitHub repository :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type tokens: list str :param token: list of GitHub tokens :type num_processes: int :param num_processes: number of processes to import the data (default 5) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-github-pr-" + db_name + "-" + project_name + "-" + issue_tracker_name self._type = type self._url = url self._project_name = project_name self._db_name = db_name self._issue_tracker_name = issue_tracker_name self._repo_name = repo_name self._before_date = before_date self._tokens = tokens config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __init__(self, db_name, project_name, type, forum_name, url, before_date, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type type: str :param type: type of the forum (Stackoverflow, Eclipse forum) :type forum_name: str :param forum_name: the name of the forum to import :type url: str :param url: the URL of the forum :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type num_processes: int :param num_processes: number of processes to import the data (default 2) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-eclipse-forum-" + db_name + "-" + project_name + "-" + forum_name self._type = type self._url = url self._forum_name = forum_name self._project_name = project_name self._db_name = db_name self._before_date = before_date config.update({'database': db_name}) self._config = config if num_processes: self._num_processes = num_processes else: self._num_processes = EclipseForum2DbMain.NUM_PROCESSES self._logging_util = LoggingUtil() self._date_util = DateUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
class StackOverflowTopic2Db(object): """ This class handles the import of Stackoverflow topics """ def __init__(self, db_name, forum_id, interval, token, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type forum_id: int :param forum_id: the id of an existing forum in the DB :type interval: list int :param interval: a list of topic ids to import :type token: str :param token: a Stackoverflow token :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._interval = interval self._db_name = db_name self._forum_id = forum_id self._token = token self._config = config self._logging_util = LoggingUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None def __call__(self): try: log_path = self._log_root_path + "-topic2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") self._querier = StackOverflowQuerier(self._token, self._logger) self._dao = StackOverflowDao(self._config, self._logger) self.extract() except Exception, e: self._logger.error("StackOverflowTopic2Db failed", exc_info=True) finally:
def __init__(self, db_name, project_name, repo_name, issue_tracker_name, url, product, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of an existing repository in the DB :type issue_tracker_name: str :param issue_tracker_name: the name of the issue tracker to import :type url: str :param url: the URL of the issue tracker :type product: str :param product: the name of the product to import from the issue tracker :type num_processes: int :param num_processes: number of processes to import the data (default 3) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "update-bugzilla-" + db_name + "-" + project_name + "-" + issue_tracker_name self._issue_tracker_name = issue_tracker_name self._url = url self._product = product self._project_name = project_name self._db_name = db_name self._repo_name = repo_name if num_processes: self._num_processes = num_processes else: self._num_processes = BugzillaIssue2DbUpdate.NUM_PROCESSES config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._dao = None
def __init__(self, db_name, project_name, repo_name, git_repo_path, extensions, references, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of the Git repository to import :type git_repo_path: str :param git_repo_path: the local path of the Git repository :type extensions: list str :param extensions: file extensions to analyse. Currently extensions supported: ['java', 'py', 'php', 'scala', 'js', 'rb', 'cs', 'cpp', 'c'] :type references: list str :param references: list of references to analyse :type num_processes: int :param num_processes: number of processes to import the data (default 5) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "update-code-" + db_name + "-" + project_name + "-" + repo_name self._git_repo_path = git_repo_path self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._extensions = extensions self._references = references if num_processes: self._num_processes = num_processes else: self._num_processes = Code2DbUpdate.NUM_PROCESSES config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __init__(self, db_name, project_name, type, forum_name, search_query, before_date, tokens, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type type: str :param type: type of the forum (Stackoverflow, Eclipse forum) :type forum_name: str :param forum_name: the name of the forum to import :type search_query: str :param search_query: a label used to mark questions in Stackoverflow :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type tokens: list str :param tokens: list of Stackoverflow tokens :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-stackoverflow-" + db_name + "-" + project_name + "-" + forum_name self._type = type self._forum_name = forum_name self._search_query = search_query.strip() self._project_name = project_name self._db_name = db_name self._before_date = before_date self._tokens = tokens config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __call__(self): self._logging_util = LoggingUtil() log_path = self._log_root_path + "-topic2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = StackOverflowQuerier(self._token, self._logger) self._dao = StackOverflowDao(self._config, self._logger) self.extract() except Exception, e: self._logger.error("StackOverflowTopic2Db failed", exc_info=True)
def __init__(self, db_name, project_name, repo_name, git_repo_path, before_date, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of the Git repository to import :type git_repo_path: str :param git_repo_path: the local path of the Git repository :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type num_processes: int :param num_processes: number of processes to import the data (default 5) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-git-" + db_name + "-" + project_name + "-" + repo_name self._git_repo_path = git_repo_path self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._before_date = before_date self._existing_refs = [] if num_processes: self._num_processes = num_processes else: self._num_processes = Git2DbUpdate.NUM_PROCESSES config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __init__(self, db_name, repo_id, git_repo_path, before_date, import_type, ref_name, ref_type, from_sha, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type repo_id: int :param repo_id: the id of an existing repository in the DB :type git_repo_path: str :param git_repo_path: local path of the Git repository :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type import_type: int :param import_type: 1 does not import patches, 2 imports patches but not at line level, 3 imports patches with line detail :type ref_name: str :param ref_name: the name of the reference to import :type from_sha: str :param from_sha: the SHA of the commit from where to start the import :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._git_repo_path = git_repo_path self._repo_id = repo_id self._db_name = db_name self._ref_name = ref_name self._ref_type = ref_type self._before_date = before_date self._import_type = import_type self._from_sha = from_sha self._config = config self._logging_util = LoggingUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None
def __call__(self): self._logging_util = LoggingUtil() log_path = self._log_root_path + "-issue2db-dependency" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = GitHubQuerier(self._url, self._token, self._logger) self._dao = GitHubDao(self._config, self._logger) self.extract() except Exception: self._logger.error("GitHubIssueDependency2Db failed", exc_info=True)
def __init__(self, db_name, project_name, type, instant_messaging_name, before_date, channels, tokens, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type type: str :param type: type of the instant messaging (Slack, IRC) :type instant_messaging_name: str :param instant_messaging_name: the name of the instant messaging to import :type channels: list str :param channels: list of channels to import :type before_date: str :param before_date: import data before date (YYYY-mm-dd) :type tokens: list str :param tokens: list of Slack tokens :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-slack-" + db_name + "-" + project_name + "-" + instant_messaging_name self._type = type self._instant_messaging_name = instant_messaging_name self._project_name = project_name self._db_name = db_name self._channels = channels self._before_date = before_date self._tokens = tokens config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __call__(self): self._logging_util = LoggingUtil() self._date_util = DateUtil() log_path = self._log_root_path + "-pr2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = GitHubQuerier(self._url, self._token, self._logger) self._dao = GitHubDao(self._config, self._logger) self._git_dao = GitDao(self._config, self._logger) self.extract() except Exception, e: self._logger.error("GitHubPullRequest2Db failed", exc_info=True)
def __call__(self): self._logging_util = LoggingUtil() self._date_util = DateUtil() log_path = self._log_root_path + "-issue2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = BugzillaQuerier(self._url, self._product, self._logger) self._dao = BugzillaDao(self._config, self._logger) self.extract() except Exception, e: self._logger.error("BugzillaIssue2Db failed", exc_info=True)
def __call__(self): self._logging_util = LoggingUtil() log_path = self._log_root_path + "-channel2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = SlackQuerier(self._token, self._logger) self._dao = SlackDao(self._config, self._logger) self.extract() except Exception: self._logger.error("Channel2Db failed", exc_info=True) finally: if self._dao: self._dao.close_connection()
def __init__(self, db_name, project_name, forum_name, eclipse_forum_url, num_processes, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type forum_name: str :param forum_name: the name of an existing forum in the DB to update :type eclipse_forum_url: str :param eclipse_forum_url: the URL of the forum :type num_processes: int :param num_processes: number of processes to import the data (default 2) :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "update-eclipse-forum-" + db_name + "-" + project_name + "-" + forum_name self._project_name = project_name self._url = eclipse_forum_url self._db_name = db_name self._forum_name = forum_name config.update({'database': db_name}) self._config = config if num_processes: self._num_processes = num_processes else: self._num_processes = EclipseForum2DbUpdate.NUM_PROCESSES self._logging_util = LoggingUtil() self._date_util = DateUtil() self._logger = None self._fileHandler = None self._querier = None self._dao = None
def __call__(self): self._logging_util = LoggingUtil() self._date_util = DateUtil() log_path = self._log_root_path + "-topic2db-" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._fileHandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = EclipseForumQuerier(None, self._logger) self._dao = EclipseForumDao(self._config, self._logger) self.extract() except Exception: self._logger.error("EclipseTopic2Db failed", exc_info=True) finally: if self._dao: self._dao.close_connection()
def __call__(self): self._logging_util = LoggingUtil() log_path = self._log_root_path + "-issue2db-dependency" + str( self._interval[0]) + "-" + str(self._interval[-1]) self._logger = self._logging_util.get_logger(log_path) self._filehandler = self._logging_util.get_file_handler( self._logger, log_path, "info") try: self._querier = BugzillaQuerier(self._url, self._product, self._logger) self._dao = BugzillaDao(self._config, self._logger) self.extract() except Exception: self._logger.error("Issue2Db failed", exc_info=True) finally: if self._dao: self._dao.close_connection()
def __init__(self, db_name, project_name, repo_name, issue_tracker_name, url, tokens, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of an existing repository in the DB :type issue_tracker_name: str :param issue_tracker_name: the name of the issue tracker to import :type url: str :param url: full name of the GitHub repository :type tokens: list str :param token: list of GitHub tokens :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "import-github-" + db_name + "-" + project_name + "-" + issue_tracker_name self._issue_tracker_name = issue_tracker_name self._url = url self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._tokens = tokens config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = None self._fileHandler = None self._dao = None
def __init__(self, db_name, repo_id, issue_tracker_id, url, interval, token, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type repo_id: int :param repo_id: the id of an existing repository in the DB :type issue_tracker_id: int :param issue_tracker_id: the id of an existing issue tracker in the DB :type url: str :param url: full name of the GitHub repository :type interval: list int :param interval: a list of issue ids to import :type token: str :param token: a GitHub token :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._url = url self._db_name = db_name self._repo_id = repo_id self._issue_tracker_id = issue_tracker_id self._interval = interval self._token = token self._config = config self._logging_util = LoggingUtil() self._date_util = DateUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None
def __init__(self, db_name, project_name, repo_name, github_repo_full_name, tokens, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type project_name: str :param project_name: the name of an existing project in the DB :type repo_name: str :param repo_name: the name of an existing repository in the DB :type url: str :param url: full name of the GitHub repository :type tokens: list str :param token: list of GitHub tokens :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "map-vcs-github-users-" + db_name + "-" + project_name + "-" + repo_name self._project_name = project_name self._db_name = db_name self._repo_name = repo_name self._tokens = tokens self._active_token = 0 self._url = github_repo_full_name config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = self._logging_util.get_logger(self._log_path) self._db_util = DbUtil() self._cnx = self._db_util.get_connection(self._config) self._git_dao = GitDao(self._config, self._logger) self._github_querier = GitHubQuerier(self._url, self._tokens[self._active_token], self._logger)
def __init__(self, db_name, repo_id, issue_tracker_id, url, product, interval, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type repo_id: int :param repo_id: the id of an existing repository in the DB :type issue_tracker_id: int :param issue_tracker_id: the id of an existing issue tracker in the DB :type url: str :param url: the URL of the bugzilla issue tracker :type product: str :param product: the name of the product in the bugzilla issue tracker :type interval: list int :param interval: a list of issue ids to import :type config: dict :param config: the DB configuration file :type log_root_path: str :param log_root_path: the log path """ self._log_root_path = log_root_path self._url = url self._product = product self._db_name = db_name self._repo_id = repo_id self._issue_tracker_id = issue_tracker_id self._interval = interval self._config = config self._logging_util = LoggingUtil() self._date_util = DateUtil() self._fileHandler = None self._logger = None self._querier = None self._dao = None
def __init__(self, db_name, config, log_root_path): """ :type db_name: str :param db_name: the name of an existing DB :type repo_name: str :param repo_name: the name of an existing repository in the DB :type log_root_path: str :param log_root_path: the log path """ self._log_path = log_root_path + "file-util-wrapper" + db_name self._db_name = db_name config.update({'database': db_name}) self._config = config self._logging_util = LoggingUtil() self._logger = self._logging_util.get_logger(self._log_path)