# Path: lacli/log.py
# def getLogger(logger='lacli'):
#     return lacore.log.getLogger(logger)


import os
import multiprocessing
from progressbar import (ProgressBar, Bar,
                         ETA, FileTransferSpeed)
from lacli.log import getLogger
from abc import ABCMeta, abstractmethod
from logutils.queue import QueueListener
        getLogger().debug("saved key: {key} ({size})".format(msg))


class StateProgressHandler(BaseProgressHandler):
    uploads = {}

    def __init__(self, state=None, **kwargs):
        assert state is not None, \
            "StateProgressHandler requires a state object"
        self.state = state
        progress = kwargs.pop('progress', 0)
        for seq, key in enumerate(self.state.keys):
            progress += key['size']
        kwargs['progress'] = progress
        super(StateProgressHandler, self).__init__(**kwargs)

    def update(self, value=None):
        if value is not None:
            self.state.update(value)
        super(StateProgressHandler, self).update(value)
        getLogger().debug("State progress: {}".format(self.state.progress))

    def __enter__(self):
        type(self).uploads[self.state] = self
        return super(StateProgressHandler, self).__enter__()

    def __exit__(self, cls, value, traceback):
        del type(self).uploads[self.state]

    def keydone(self, msg):

# Path: lacli/log.py
# def getLogger(logger='lacli'):
#     return lacore.log.getLogger(logger)


# Path: lacli/progress.py
import os
import multiprocessing
from progressbar import (ProgressBar, Bar,
                         ETA, FileTransferSpeed)
from lacli.log import getLogger
from abc import ABCMeta, abstractmethod
from logutils.queue import QueueListener

        getLogger().debug("saved key: {key} ({size})".format(msg))


class StateProgressHandler(BaseProgressHandler):
    uploads = {}

    def __init__(self, state=None, **kwargs):
        assert state is not None, \
            "StateProgressHandler requires a state object"
        self.state = state
        progress = kwargs.pop('progress', 0)
        for seq, key in enumerate(self.state.keys):
            progress += key['size']
        kwargs['progress'] = progress
        super(StateProgressHandler, self).__init__(**kwargs)

    def update(self, value=None):
        if value is not None:
            self.state.update(value)
        super(StateProgressHandler, self).update(value)
        getLogger().debug("State progress: {}".format(self.state.progress))

    def __enter__(self):
        type(self).uploads[self.state] = self
        return super(StateProgressHandler, self).__enter__()

    def __exit__(self, cls, value, traceback):
        del type(self).uploads[self.state]

    def keydone(self, msg):

        getLogger().debug("saving key " + str(msg['key']) + " to state file")