Example #1
0
    def __init__(self, idUser, host='localhost'):
        """
        to start the RabbitMQ server, open your terminal and type:

        export PATH=$PATH:/usr/local/opt/rabbitmq/sbin <enter>
        Rabbitmq-server <enter>

        to access management panel open your browser and type http://localhost:15672 or 5672 by default
        """

        self.connection = None
        self.channel = None
        self.__loggerNoSQL = loggerNoSQL()
        self.__idUser = idUser
        self.qBase = qBase()
        self.host = host
        self.port = 15672

        self.queueNames = [
            taskQueueName.EXCEPTION_ERROR(),
            taskQueueName.LOG_INFO(),
            taskQueueName.SEND_MAIL()
        ]

        self.testConnection()
Example #2
0
    def __init__(self, keep=None, idUser=None):
        super().__init__(keep)
        self.idInserted = 0

        self.__logger = logger()
        self.__loggerNoSQL = loggerNoSQL()
        self.__idUser = idUser
        self.__lista1 = []
        self.__recipe = None
        self.qBase = qBase()
Example #3
0
def listOfLogs():
    rec = json.loads(request.get_data())

    keep = rec['keep']
    idUser = int(rec['idUser'])
    data1 = rec['data']
    start = int(rec['start'])
    limit = int(rec['limit'])

    log = loggerNoSQL()

    result = log.testListLogs(data1, start, limit)

    return result
Example #4
0
    def __init__(self, idUser, host='localhost'):
        """
        to start the RabbitMQ server, open your terminal and type:
        
        export PATH=$PATH:/usr/local/opt/rabbitmq/sbin
        Rabbitmq-server <enter>

        to access management panel open your browser and type http://localhost:15672 by default
        """

        cnn = rabbitMQConnection(idUser, host)
        self.connection = cnn.connection
        self.channel = cnn.channel
        self.queueNames = cnn.queueNames
        del cnn

        self.__loggerNoSQL = loggerNoSQL()
        self.__idUser = idUser
        self.qBase = qBase()
Example #5
0
 def __init__(self, keep=None, idUser=None):
     self.qBase = qBase(keep)
     self.__loggerNoSQL = loggerNoSQL()
     self.__listOfUsers = []
     self.__idUser = idUser
     self.__recUser = None
Example #6
0
 def __init__(self):
     self.response = Responses()
     self.__loggerNoSQL = loggerNoSQL()
Example #7
0
import unittest

from app.base.loggerNoSQL import loggerNoSQL

l1 = loggerNoSQL()

l1.newLog('message of Today 1', "ERROR", "Tests", 1)


class Foo:
    def __init__(self, val):
        self.val = val

    def __eq__(self, other):
        return self.val == other.val


def test_compare():
    f1 = Foo(1)
    f2 = Foo(2)
    try:
        assert f1 == f2
    except AssertionError as ae:
        print(ae)


#test_compare()