# Path: vise/constants.py
# DOWNLOADS_URL = 'vise:downloads'
# WELCOME_URL = 'vise:welcome'
# STATUS_BAR_HEIGHT = 24
# FOLLOW_LINK_KEY_MAP = {getattr(Qt.Key, 'Key_' + x.upper()): x for x in string.ascii_lowercase + string.digits}
# VISE_SCHEME = 'vise'
# def _get_cache_dir():
# def _get_config_dir():
# def get_windows_username():
# def local_socket_address():
# 
# Path: vise/resources.py
# def get_data_as_file(name):
#     return open(get_data_as_path(name), 'rb')


import os
from functools import lru_cache
from yaml import safe_load
from .constants import config_dir, hostname
from .resources import get_data_as_file
    for ftype, val in uff.items():
        val = get_ff(val)
        if isinstance(val, str):
            families[ftype] = val

    for ftype, val in dff.items():
        if ftype not in families:
            val = get_ff(val)
            if isinstance(val, str):
                families[ftype] = val

    return families


@lru_cache()
def font_sizes():
    uff = (load_config(user=True).get('fonts') or {}).get('sizes') or {}
    dff = load_config(user=False)['fonts']['sizes']
    sizes = {}

    def conv(x):
        if x == 'default':
            return 0
        try:
            return int(x)
        except Exception:
            pass

    def get_ff(x):
        if isinstance(x, dict):

# Path: vise/constants.py
# DOWNLOADS_URL = 'vise:downloads'
# WELCOME_URL = 'vise:welcome'
# STATUS_BAR_HEIGHT = 24
# FOLLOW_LINK_KEY_MAP = {getattr(Qt.Key, 'Key_' + x.upper()): x for x in string.ascii_lowercase + string.digits}
# VISE_SCHEME = 'vise'
# def _get_cache_dir():
# def _get_config_dir():
# def get_windows_username():
# def local_socket_address():
# 
# Path: vise/resources.py
# def get_data_as_file(name):
#     return open(get_data_as_path(name), 'rb')


# Path: vise/config.py
import os
from functools import lru_cache
from yaml import safe_load
from .constants import config_dir, hostname
from .resources import get_data_as_file

    for ftype, val in uff.items():
        val = get_ff(val)
        if isinstance(val, str):
            families[ftype] = val

    for ftype, val in dff.items():
        if ftype not in families:
            val = get_ff(val)
            if isinstance(val, str):
                families[ftype] = val

    return families


@lru_cache()
def font_sizes():
    uff = (load_config(user=True).get('fonts') or {}).get('sizes') or {}
    dff = load_config(user=False)['fonts']['sizes']
    sizes = {}

    def conv(x):
        if x == 'default':
            return 0
        try:
            return int(x)
        except Exception:
            pass

    def get_ff(x):
        if isinstance(x, dict):

            return conv(x.get(hostname) or x.get('*'))