<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ovastypes import *
from datetime import *

# -- Describe TASKS
# CREATE TABLE tasks   (id INTEGER PRIMARY KEY, uuid, owner INTEGER, name, hidden INTEGER, time, comment, description, run_status INTEGER
# , start_time, end_time, config INTEGER, target INTEGER, schedule INTEGER, schedule_next_time, slave INTEGER, config_location INTEGER, 
# target_location INTEGER, schedule_location INTEGER, slave_location INTEGER, upload_result_count INTEGER, creation_time, modification_time)

class OvasReceiver(object):
    """docstring for OvasReceiver"""
    def __init__(self):
        super(OvasReceiver, self).__init__()

    def set_db_path(self, dbpath):
    	database = SqliteDatabase(dbpath)
    	database_proxy.initialize(database)
    	pass

    def get_all_tasks_data(self):
        allscans = []
        print(Tasks._meta.database.__dict__)
        for scan in Tasks.select():
            allscans.append(scan)
        return allscans

    def get_all_tasks_count(self):
        return Tasks.select().count()

    def get_all_results(self):
        allresults = []
        print(Results._meta.database.__dict__)
        for result in Results.select():
            allresults.append(result)
        return allresults

    def get_all_results_count():
        return Results.select().count()<commit_msg>fix for method declaration<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

from ovastypes import *
from datetime import *

# -- Describe TASKS
# CREATE TABLE tasks   (id INTEGER PRIMARY KEY, uuid, owner INTEGER, name, hidden INTEGER, time, comment, description, run_status INTEGER
# , start_time, end_time, config INTEGER, target INTEGER, schedule INTEGER, schedule_next_time, slave INTEGER, config_location INTEGER, 
# target_location INTEGER, schedule_location INTEGER, slave_location INTEGER, upload_result_count INTEGER, creation_time, modification_time)

class OvasReceiver(object):
    """docstring for OvasReceiver"""
    def __init__(self):
        super(OvasReceiver, self).__init__()

    def set_db_path(self, dbpath):
    	database = SqliteDatabase(dbpath)
    	database_proxy.initialize(database)
    	pass

    def get_all_tasks_data(self):
        allscans = []
        print(Tasks._meta.database.__dict__)
        for scan in Tasks.select():
            allscans.append(scan)
        return allscans

    def get_all_tasks_count(self):
        return Tasks.select().count()

    def get_all_results(self):
        allresults = []
        print(Results._meta.database.__dict__)
        for result in Results.select():
            allresults.append(result)
        return allresults

    def get_all_results_count(self):
        return Results.select().count()

{'fraction_non_alphanumeric': 0.09506531204644413, 'fraction_numerical': 0.000725689404934688, 'mean_word_length': 3.46839546191248, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5073125', 'n_tokens_mistral': 839, 'n_tokens_neox': 776, 'n_words': 200}