def set_logger(master_logger):
    global _logger
    _logger = master_logger
    shared_file_messenger.set_logger(master_logger)
def set_logger(master_logger):
    global _logger
    _logger = master_logger
    shared_file_messenger.set_logger(master_logger)
import json
import os
import os.path
import threading
from queue import Queue
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.db_proxy_pool import DBProxyPool as DBProxy
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermessenger import shared_file_messenger

# logger
_logger = core_utils.setup_logger('http_server_messenger')
shared_file_messenger.set_logger(_logger)


def set_logger(master_logger):
    global _logger
    _logger = master_logger
    shared_file_messenger.set_logger(master_logger)


# handler for http front-end
class HttpHandler(BaseHTTPRequestHandler):

    def __init__(self, *args, **kwargs):
        self.dbProxy = DBProxy()
        self.tmpLog = None
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
from queue import Queue
from http.server import HTTPServer, BaseHTTPRequestHandler
# try:
#     from urllib.parse import parse_qsl
# except ImportError:
#     from cgi import parse_qsl
from socketserver import ThreadingMixIn
from pandaharvester.harvestercore import core_utils
from pandaharvester.harvestercore.db_proxy_pool import DBProxyPool as DBProxy
from pandaharvester.harvesterconfig import harvester_config
from pandaharvester.harvestermessenger import shared_file_messenger

# logger
_logger = core_utils.setup_logger('http_server_messenger')
shared_file_messenger.set_logger(_logger)


def set_logger(master_logger):
    global _logger
    _logger = master_logger
    shared_file_messenger.set_logger(master_logger)


# handler for http front-end
class HttpHandler(BaseHTTPRequestHandler):

    def __init__(self, *args, **kwargs):
        self.dbProxy = DBProxy()
        self.tmpLog = None
        BaseHTTPRequestHandler.__init__(self, *args, **kwargs)