Example #1
0
def start_durus(host, port, logfilename, dbfilename):
    logfile = open(logfilename, 'a+')
    direct_output(logfile)
    logger.setLevel(9)
    storage = FileStorage(dbfilename, repair=False, readonly=False)
    log(20, 'Storage file=%s host=%s port=%s', storage.get_filename(), host, port)
    StorageServer(storage, host=host, port=port).serve()
Example #2
0
def start_durus(host, port, logfilename, dbfilename):
    logfile = open(logfilename, 'a+')
    direct_output(logfile)
    logger.setLevel(9)
    storage = FileStorage(dbfilename, repair=False, readonly=False)
    log(20, 'Storage file=%s host=%s port=%s', storage.get_filename(), host,
        port)
    StorageServer(storage, host=host, port=port).serve()
Example #3
0
def startDurus(host, port, logfilename, dbfilename):
    """Start and initialize the Durus server component.

  Also opens a log file.
  """
    lf = logfile.open(logfilename, 50000)
    direct_output(lf)
    logger.setLevel(9)
    storage = FileStorage(dbfilename, repair=False, readonly=False)
    log(20, 'Storage file=%s host=%s port=%s', storage.get_filename(), host,
        port)
    StorageServer(storage, host=host, port=port).serve()
Example #4
0
def start_durus(logfile, logginglevel, address, storage, gcbytes):
    if logfile is None:
        logfile = sys.stderr
    else:
        logfile = open(logfile, 'a+')
    direct_output(logfile)
    logger.setLevel(logginglevel)
    socket_address = SocketAddress.new(address)
    if hasattr(storage, 'get_filename'):
        log(20, 'Storage file=%s address=%s',
            storage.get_filename(), socket_address)
    StorageServer(storage, address=socket_address, gcbytes=gcbytes).serve()
Example #5
0
def import_durus():
    old_stdout = sys.stdout
    old_stderr = sys.stderr
    sys.stdout = sys.__stdout__
    sys.stderr = sys.__stderr__
    from durus import logger
    logger.direct_output(open(paths.data_path('durus.log'), 'w'))
    sys.stdout = old_stdout
    sys.stderr = old_stderr
    from durus.file_storage import FileStorage
    from durus.connection import Connection
    return (FileStorage, Connection)
Example #6
0
def import_durus():
 old_stdout = sys.stdout
 old_stderr = sys.stderr
 sys.stdout = sys.__stdout__
 sys.stderr = sys.__stderr__
 from durus import logger
 logger.direct_output(open(paths.data_path('durus.log'), 'w'))
 sys.stdout = old_stdout
 sys.stderr = old_stderr
 from durus.file_storage import FileStorage
 from durus.connection import Connection
 return (FileStorage, Connection)
Example #7
0
def start_durus(host, port, logfilename, dbfilename):
    logfile = open(logfilename, 'a+')
    direct_output(logfile)
    logger.setLevel(9)
    storage = FileStorage(dbfilename, repair=False, readonly=False)
    """ 
    In Durus 2.6, there was a fp.name member data.  However it doesn't exist in Durus 2.7.
    However, in both 2.6 and 2.7, there is a get_filename() method that will work.
    #log(20, 'Storage file=%s host=%s port=%s', storage.fp.name, host, port)
    """
    log(20, 'Storage file=%s host=%s port=%s',storage.get_filename(), host, port)
    StorageServer(storage, host=host, port=port).serve()
Example #8
0
def start_durus(logfile, logginglevel, file, repair, readonly, host, port):
    if logfile is None:
        logfile = sys.stderr
    else:
        logfile = open(logfile, 'a+')
    direct_output(logfile)
    logger.setLevel(logginglevel)
    if file is None:
        storage = TempFileStorage()
    else:
        storage = FileStorage(file, repair=repair,
                              readonly=readonly)
    log(20, 'Storage file=%s host=%s port=%s', storage.fp.name, host, port)
    StorageServer(storage, host=host, port=port).serve()
Example #9
0
 def _pre(self):
     direct_output(sys.stdout)
Example #10
0
 def _pre(self):
     direct_output(sys.stdout)
Example #11
0
 def setup(self):
     direct_output(sys.stdout)