# Path: jasy/core/Util.py
# def getKey(data, key, default=None):
#     """
#     Returns the key from the data if available or the given default
# 
#     :param data: Data structure to inspect
#     :type data: dict
#     :param key: Key to lookup in dictionary
#     :type key: str
#     :param default: Default value to return when key is not set
#     :type default: any
#     """
# 
#     if key in data:
#         return data[key]
#     else:
#         return default
# 
# Path: jasy/core/Config.py
# def loadConfig(fileName, encoding="utf-8"):
#     """
#     Loads the given configuration file (filename without extension) and 
#     returns the parsed object structure 
#     """
# 
#     configName = findConfig(fileName)
#     if configName is None:
#         raise UserError("Unsupported config file: %s" % fileName)
# 
#     fileHandle = open(configName, mode="r", encoding=encoding)    
# 
#     fileExt = os.path.splitext(configName)[1]
#     if fileExt == ".json":
#         result = json.load(fileHandle)
# 
#     elif fileExt == ".yaml":
#         result = yaml.load(fileHandle)
# 
#     fileHandle.close()
#     return result


import os.path
import jasy.asset.ImageInfo
import jasy.item.Abstract
import jasy.core.Console as Console
from jasy.core.Util import getKey
from jasy.core.Config import loadConfig
    ".svg" : "text",
    ".txt" : "text",
    ".csv" : "text",
    ".html" : "text",
    ".js" : "text",
    ".css" : "text",
    ".htc" : "text",
    ".xml" : "text",
    ".tmpl" : "text",
    
    ".fla" : "binary",
    ".swf" : "binary",
    ".psd" : "binary",
    ".pdf" : "binary"
}


class AssetItem(jasy.item.Abstract.AbstractItem):
    
    kind = "asset"

    __imageSpriteData = []
    __imageAnimationData = []
    __imageDimensionData = []

    def __init__(self, project, id=None):
        # Call Item's init method first
        super().__init__(project, id)

        self.extension = os.path.splitext(self.id.lower())[1]

# Path: jasy/core/Util.py
# def getKey(data, key, default=None):
#     """
#     Returns the key from the data if available or the given default
# 
#     :param data: Data structure to inspect
#     :type data: dict
#     :param key: Key to lookup in dictionary
#     :type key: str
#     :param default: Default value to return when key is not set
#     :type default: any
#     """
# 
#     if key in data:
#         return data[key]
#     else:
#         return default
# 
# Path: jasy/core/Config.py
# def loadConfig(fileName, encoding="utf-8"):
#     """
#     Loads the given configuration file (filename without extension) and 
#     returns the parsed object structure 
#     """
# 
#     configName = findConfig(fileName)
#     if configName is None:
#         raise UserError("Unsupported config file: %s" % fileName)
# 
#     fileHandle = open(configName, mode="r", encoding=encoding)    
# 
#     fileExt = os.path.splitext(configName)[1]
#     if fileExt == ".json":
#         result = json.load(fileHandle)
# 
#     elif fileExt == ".yaml":
#         result = yaml.load(fileHandle)
# 
#     fileHandle.close()
#     return result


# Path: jasy/item/Asset.py
import os.path
import jasy.asset.ImageInfo
import jasy.item.Abstract
import jasy.core.Console as Console
from jasy.core.Util import getKey
from jasy.core.Config import loadConfig

    ".svg" : "text",
    ".txt" : "text",
    ".csv" : "text",
    ".html" : "text",
    ".js" : "text",
    ".css" : "text",
    ".htc" : "text",
    ".xml" : "text",
    ".tmpl" : "text",
    
    ".fla" : "binary",
    ".swf" : "binary",
    ".psd" : "binary",
    ".pdf" : "binary"
}


class AssetItem(jasy.item.Abstract.AbstractItem):
    
    kind = "asset"

    __imageSpriteData = []
    __imageAnimationData = []
    __imageDimensionData = []

    def __init__(self, project, id=None):
        # Call Item's init method first
        super().__init__(project, id)

        self.extension = os.path.splitext(self.id.lower())[1]

        self.type = getKey(extensions, self.extension, "other")