# Path: epymc/utils.py
#     XDG_CONFIG_HOME = ''
#     XDG_CACHE_HOME = ''
# def LOG(*args):
# def DBG(msg):
# def iso639_1_to_3(iso1):
# def iso639_1_to_5(iso1):
# def is_py3():
# def is_py2():
# def get_resource_file(res_type, res_name, default=None):
# def get_available_themes():
# def in_use_theme_file_set(theme_file):
# def url2path(url):
# def hum_size(bites):
# def seconds_to_duration(seconds, hours=False):
# def splitpath(path):
# def ensure_file_not_exists(fullpath):
# def md5(txt):
# def user_name():
# def natural_sort(li):
# def natural_cmp(a, b):
# def grab_files(folders, show_hidden=False, recursive=True):
# def download_url_async(url, dest='tmp', min_size=0,
#                        complete_cb=None, progress_cb=None,
#                        urlencode=True, *args, **kargs):
#     def _cb_download_complete(dest, status, dwl_data, *args, **kargs):
#     def _cb_download_progress(dest, dltotal, dlnow, uptotal, upnow, dwl_data, *args, **kargs):
# def download_abort(dwl_handler):
# def http_error_code_to_str(code):
# def distance_between_point_and_segment(point, segment_p1, segment_p2, real=False):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, cmd, grab_output=False, done_cb=None, *args, **kargs):
#     def data_cb(self, exe, event):
#     def del_cb(self, exe, event):
#     def __init__(self, url, done_cb=None, prog_cb=None, headers=None, **kargs):
#     def _complete_cb(self, event):
#     def _data_cb(self, event):
# class Singleton(object):
# class EmcExec(object):
# class EmcUrl(ecore_con.Url):
# 
# Path: epymc/ini.py
# def read_from_files(files):
# def write_to_file(file):
# def setup_defaults():
# def add_section(section):
# def has_section(section):
# def has_option(section, option):
# def has_options(options):
# def get_options(section):
# def get(section, option, default_value=None):
# def get_string_list(section, option, separator=' '):
# def get_int(section, option):
# def get_float(section, option):
# def get_bool(section, option):
# def get_string(section, option):
# def set(section, option, value):
# def set_string_list(section, option, values, separator=' '):
# def remove_option(section, option):


import os
from collections import OrderedDict
from efl import ecore
from epymc import utils
from epymc import ini
            DBG('slave started succesfully')
            self._starting = False
            if self._item is not None:
                self._send_request()
            return
        else:
            success = False
            ERR('error or unknown msg from slave "%s"' % msg)

        self.item_completed(success)


class EmcThumbnailer(utils.Singleton):
    """ Thumbnailer Workers Manager

    Never instantiate this class directly !!

    Instead use the module level emc_thumbnailer instance.

    """

    def __init__(self):
        DBG('manager init')
        self._workers_pool = []
        self._queue = OrderedDict()  # key: req_id  val: ThumbItem instance

    # public api
    @staticmethod
    def thumb_path_get(url):
        """ Generate and return the thumbnail path for the given uri """

# Path: epymc/utils.py
#     XDG_CONFIG_HOME = ''
#     XDG_CACHE_HOME = ''
# def LOG(*args):
# def DBG(msg):
# def iso639_1_to_3(iso1):
# def iso639_1_to_5(iso1):
# def is_py3():
# def is_py2():
# def get_resource_file(res_type, res_name, default=None):
# def get_available_themes():
# def in_use_theme_file_set(theme_file):
# def url2path(url):
# def hum_size(bites):
# def seconds_to_duration(seconds, hours=False):
# def splitpath(path):
# def ensure_file_not_exists(fullpath):
# def md5(txt):
# def user_name():
# def natural_sort(li):
# def natural_cmp(a, b):
# def grab_files(folders, show_hidden=False, recursive=True):
# def download_url_async(url, dest='tmp', min_size=0,
#                        complete_cb=None, progress_cb=None,
#                        urlencode=True, *args, **kargs):
#     def _cb_download_complete(dest, status, dwl_data, *args, **kargs):
#     def _cb_download_progress(dest, dltotal, dlnow, uptotal, upnow, dwl_data, *args, **kargs):
# def download_abort(dwl_handler):
# def http_error_code_to_str(code):
# def distance_between_point_and_segment(point, segment_p1, segment_p2, real=False):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, cmd, grab_output=False, done_cb=None, *args, **kargs):
#     def data_cb(self, exe, event):
#     def del_cb(self, exe, event):
#     def __init__(self, url, done_cb=None, prog_cb=None, headers=None, **kargs):
#     def _complete_cb(self, event):
#     def _data_cb(self, event):
# class Singleton(object):
# class EmcExec(object):
# class EmcUrl(ecore_con.Url):
# 
# Path: epymc/ini.py
# def read_from_files(files):
# def write_to_file(file):
# def setup_defaults():
# def add_section(section):
# def has_section(section):
# def has_option(section, option):
# def has_options(options):
# def get_options(section):
# def get(section, option, default_value=None):
# def get_string_list(section, option, separator=' '):
# def get_int(section, option):
# def get_float(section, option):
# def get_bool(section, option):
# def get_string(section, option):
# def set(section, option, value):
# def set_string_list(section, option, values, separator=' '):
# def remove_option(section, option):


# Path: epymc/thumbnailer.py
import os
from collections import OrderedDict
from efl import ecore
from epymc import utils
from epymc import ini

            DBG('slave started succesfully')
            self._starting = False
            if self._item is not None:
                self._send_request()
            return
        else:
            success = False
            ERR('error or unknown msg from slave "%s"' % msg)

        self.item_completed(success)


class EmcThumbnailer(utils.Singleton):
    """ Thumbnailer Workers Manager

    Never instantiate this class directly !!

    Instead use the module level emc_thumbnailer instance.

    """

    def __init__(self):
        DBG('manager init')
        self._workers_pool = []
        self._queue = OrderedDict()  # key: req_id  val: ThumbItem instance

    # public api
    @staticmethod
    def thumb_path_get(url):
        """ Generate and return the thumbnail path for the given uri """

        fname = utils.md5(url) + '.jpg'