コード例 #1
0
 def create(cls, file, module, cls_name, func, elapsed):
     """Inserts a new time sample into the database with the given information.
     
     :param file: The file the sample is from
     :type file: str
     :param module: The module the sample is from
     :type module: str
     :param cls_name: The name of the class the sample is from
     :type cls_name: str
     :param func: The name of the function the sample is from
     :type func: str
     :param elapsed: The elapsed time in seconds
     :type elapsed: float
     
     """
     q = "INSERT INTO {} VALUES('{}', '{}', '{}', '{}', {})"
     SqliteConnection.get().execute(
         q.format(cls.meta['table'], file, module, cls_name, func, elapsed))
コード例 #2
0
ファイル: plugin.py プロジェクト: etscrivner/nose-perfdump
 def configure(self, options, conf):
     """Configure this plugin using the given options"""
     super(PerfDumpPlugin, self).configure(options, conf)
     if not self.enabled:
         return
     try:
         self.html_output_file = options.perfdump_html_file
     except:
         pass
     self.db = SqliteConnection.get(self.database_name)
コード例 #3
0
ファイル: plugin.py プロジェクト: etscrivner/nose-perfdump
 def configure(self, options, conf):
     """Configure this plugin using the given options"""
     super(PerfDumpPlugin, self).configure(options, conf)
     if not self.enabled:
         return
     try:
         self.html_output_file = options.perfdump_html_file
     except:
         pass
     self.db = SqliteConnection.get(self.database_name)
コード例 #4
0
ファイル: models.py プロジェクト: etscrivner/nose-perfdump
 def create(cls, file, module, cls_name, func, elapsed):
     """Inserts a new time sample into the database with the given information.
     
     :param file: The file the sample is from
     :type file: str
     :param module: The module the sample is from
     :type module: str
     :param cls_name: The name of the class the sample is from
     :type cls_name: str
     :param func: The name of the function the sample is from
     :type func: str
     :param elapsed: The elapsed time in seconds
     :type elapsed: float
     
     """
     q = "INSERT INTO {} VALUES('{}', '{}', '{}', '{}', {})"
     SqliteConnection.get().execute(q.format(cls.meta['table'],
                                             file,
                                             module,
                                             cls_name,
                                             func,
                                             elapsed))
コード例 #5
0
ファイル: console.py プロジェクト: etscrivner/nose-perfdump
 def preloop(self):
     self.db = SqliteConnection.get()
     self.db.row_factory = sqlite3.Row
コード例 #6
0
ファイル: models.py プロジェクト: etscrivner/nose-perfdump
 def get_cursor(cls):
     """Return a message list cursor that returns sqlite3.Row objects"""
     db = SqliteConnection.get()
     db.row_factory = sqlite3.Row
     return db.cursor()
コード例 #7
0
 def get_cursor(cls):
     """Return a message list cursor that returns sqlite3.Row objects"""
     db = SqliteConnection.get()
     db.row_factory = sqlite3.Row
     return db.cursor()