# Path: kano_profile/paths.py
# TRACKER_UUIDS_PATH = os.path.join(kanoprofile_dir, 'tracker', 'uuids')
# PAUSED_SESSIONS_FILE = os.path.join(kanoprofile_dir, '.paused_sessions')
# 
# Path: kano_profile_gui/paths.py



import os
import json
import imp
from kano.logging import logger
from kano.utils import ensure_dir, run_cmd
from .paths import profile_dir
from kano_profile_gui.paths import media_dir
from kano.notifications import display_generic_notification

def api_version(version):
    """
        Request a certain version of the API.

        :param version: The requested version of the API.
        :type version: dict

        :raises RuntimeError: If the request cannot be satisfied.
        :returns: None
    """

    if ('major' in version and version['major'] != API_VERSION['major']) or \
       ('minor' in version and version['minor'] > API_VERSION['minor']):
        msg = 'Trying to load a quest with incompatible API'
        logger.warn(msg)
        raise RuntimeError(msg)


def profile_media(media_path):
    """
        Get the full path to a media file in profile's directory.

        :param media_path: Relative path to the media file.
        :type media_path: string

        :raises OSError: If the file doesn't exist.
        :returns: The absolute path to the file.
    """


# Path: kano_profile/paths.py
# TRACKER_UUIDS_PATH = os.path.join(kanoprofile_dir, 'tracker', 'uuids')
# PAUSED_SESSIONS_FILE = os.path.join(kanoprofile_dir, '.paused_sessions')
# 
# Path: kano_profile_gui/paths.py



# Path: kano_profile/quests.py
import os
import json
import imp
from kano.logging import logger
from kano.utils import ensure_dir, run_cmd
from .paths import profile_dir
from kano_profile_gui.paths import media_dir
from kano.notifications import display_generic_notification


def api_version(version):
    """
        Request a certain version of the API.

        :param version: The requested version of the API.
        :type version: dict

        :raises RuntimeError: If the request cannot be satisfied.
        :returns: None
    """

    if ('major' in version and version['major'] != API_VERSION['major']) or \
       ('minor' in version and version['minor'] > API_VERSION['minor']):
        msg = 'Trying to load a quest with incompatible API'
        logger.warn(msg)
        raise RuntimeError(msg)


def profile_media(media_path):
    """
        Get the full path to a media file in profile's directory.

        :param media_path: Relative path to the media file.
        :type media_path: string

        :raises OSError: If the file doesn't exist.
        :returns: The absolute path to the file.
    """


    path = os.path.join(media_dir, media_path)