Exemplo n.º 1
0
def main():
    from settings import settings
    st = settings.Settings()
    populate = PopulateCVE(st.load())
    from apps.mongo import Mongo
    mongo = Mongo()
    if mongo.elements_count() == 0:
        mongo.close()
        populate.run()
    return 0
Exemplo n.º 2
0
def main():
    config = settings.Settings()
    survey = surveymonkey.Surveymonkey(config)
    r = survey.create_new_survey()
    print(r)

    s = survey.get_survey_details()
    print(s)

    t = survey.update_survey_page()
    print(t)

    print(config.survey_href)
    print(config.pages_href)
    u = survey.add_survey_questions()
    print(u)

    v = survey.create_collector()
    print(v)
    print()
    print(f'The survey url is: {v["url"]}')
Exemplo n.º 3
0
import os
import sys
import ast
import json
import datetime

runPath = os.path.dirname(os.path.realpath(__file__))
sys.path.append(os.path.join(runPath, ".."))

from settings import settings
st = settings.Settings()
cfg = st.load()

from apps.cache import Cache
from apps.mongo import Mongo

cache = Cache()
mongo = Mongo()


def main():
    run_time = datetime.datetime.now()
    while True:
        if not cache.empty_tasks():
            t = cache.get_last_task()
            last_task = ast.literal_eval(t)
            # last_task = json.loads(t)
            if last_task is not None:
                if last_task['data'] is not None:
                    data = last_task['data']
                    if 'type' in last_task:
Exemplo n.º 4
0
def main():
    from settings import settings
    st = settings.Settings()
    update = UpdateCVE(st.load())
    update.run()
    return 0
Exemplo n.º 5
0
"""
Main file for PyEveLiveDPS

Initializes settings, the logger, then runs the main tkinter components
also spawns a separate thread to perform the update checker

"""

from settings import settings
settings = settings.Settings()

import threading
import multiprocessing
import logging
from logging.handlers import RotatingFileHandler
import platform
import os

class App():
    def __init__(self):
        # imports happen in app init to prevent issues with files importing each other to get logger/settings
        import mainWindow
        import updateChecker
        SetupLogger()
        graphWindow = mainWindow.MainWindow()
        updateCheckerThread = updateChecker.UpdateChecker()
        updateCheckerThread.start()
        graphWindow.mainloop()
    
def SetupLogger():
    """