# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


from subprocess import Popen
from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log
import os
import sys
        MY_CWD = os.path.dirname(HERE)

log.app.info(u"l5rcm base dir: %s", MY_CWD)


def get_app_file(rel_path):
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/l5rcm', rel_path)
    else:
        sys_path = '/usr/share/l5rcm'
        if os.path.exists(sys_path):
            return os.path.join(sys_path, rel_path)
        return os.path.join(MY_CWD, 'share/l5rcm', rel_path)


def get_app_icon_path(size=(48, 48)):
    size_str = '%dx%d' % size
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/icons/l5rcm/%s' % size_str, APP_NAME + '.png')
    else:
        sys_path = '/usr/share/icons/l5rcm/%s' % size_str
        if os.path.exists(sys_path):
            return os.path.join(sys_path, APP_NAME + '.png')
        return os.path.join(MY_CWD, 'share/icons/l5rcm/%s' % size_str, APP_NAME + '.png')


def get_tab_icon(name):
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/icons/l5rcm/tabs/', name + '.png')
    else:

# Path: l5r/util/log.py
# def log_setup(base_path, base_name):


# Path: l5r/util/fsutil.py
from subprocess import Popen
from PyQt5 import QtCore, QtGui, QtWidgets
from l5r.util import log
import os
import sys

        MY_CWD = os.path.dirname(HERE)

log.app.info(u"l5rcm base dir: %s", MY_CWD)


def get_app_file(rel_path):
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/l5rcm', rel_path)
    else:
        sys_path = '/usr/share/l5rcm'
        if os.path.exists(sys_path):
            return os.path.join(sys_path, rel_path)
        return os.path.join(MY_CWD, 'share/l5rcm', rel_path)


def get_app_icon_path(size=(48, 48)):
    size_str = '%dx%d' % size
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/icons/l5rcm/%s' % size_str, APP_NAME + '.png')
    else:
        sys_path = '/usr/share/icons/l5rcm/%s' % size_str
        if os.path.exists(sys_path):
            return os.path.join(sys_path, APP_NAME + '.png')
        return os.path.join(MY_CWD, 'share/icons/l5rcm/%s' % size_str, APP_NAME + '.png')


def get_tab_icon(name):
    if os.name == 'nt':
        return os.path.join(MY_CWD, 'share/icons/l5rcm/tabs/', name + '.png')
    else:

        sys_path = '/usr/share/icons/l5rcm/tabs/'