# Path: skema/api.py
# class SkemaTagIf(object):
#     """
#     Skema tag.
# 
#     Abstract class for skema tag classes.
#     """
# 
#     @abstractmethod
#     def install(self):
#         """
#         Install the tag.
# 
#         This creates an install directory under the user's XDG_DATA_HOME
#         directory to mark that the tag is installed.  The installer's
#         install() method is then called from this directory to complete any
#         test specific install that may be needed.
#         """
# 
#     @abstractmethod
#     def uninstall(self):
#         """
#         Uninstall the test tag.
# 
#         Uninstalling just recursively removes the test specific directory under
#         the user's XDG_DATA_HOME directory.  This will both mark the tag as
#         removed, and clean up any files that were installed under that
#         directory.  Dependencies are intentionally not removed by this.
#         """
# 
#     @abstractmethod
#     def run(self, element, context):
#         # TODO: Document me
#         pass
# 
# Path: skema/config.py
# def get_config():
#     global _config
#     if _config is not None:
#         return _config
#     _config = SkemaConfig()
#     return _config


import os
import shutil
from skema.api import SkemaTagIf
from skema.config import get_config
        test specific install that may be needed.
        """
        #if not self.installer:
        #    raise RuntimeError("no installer defined for '%s'" %
        #                        self.tagsdir)

        config = get_config()
        tagsdir = os.path.join(config.tagsdir, self.tagsdir)
        if os.path.exists(tagsdir):
            raise RuntimeError("%s is already installed" % self.tagsdir)
        os.makedirs(tagsdir)
        os.chdir(tagsdir)
        #try:
        #    self.installer.install()
        #except Exception as strerror:
        #    self.uninstall()
        #    raise
        #finally:
        os.chdir(self.origdir)

    def uninstall(self):
        """Uninstall the test tag.

        Uninstalling just recursively removes the test specific directory
        under the user's XDG_DATA_HOME directory.  This will both mark
        the test as removed, and clean up any files that were downloaded
        or installed under that directory.  Dependencies are intentionally
        not removed by this.
        """
        os.chdir(self.origdir)

# Path: skema/api.py
# class SkemaTagIf(object):
#     """
#     Skema tag.
# 
#     Abstract class for skema tag classes.
#     """
# 
#     @abstractmethod
#     def install(self):
#         """
#         Install the tag.
# 
#         This creates an install directory under the user's XDG_DATA_HOME
#         directory to mark that the tag is installed.  The installer's
#         install() method is then called from this directory to complete any
#         test specific install that may be needed.
#         """
# 
#     @abstractmethod
#     def uninstall(self):
#         """
#         Uninstall the test tag.
# 
#         Uninstalling just recursively removes the test specific directory under
#         the user's XDG_DATA_HOME directory.  This will both mark the tag as
#         removed, and clean up any files that were installed under that
#         directory.  Dependencies are intentionally not removed by this.
#         """
# 
#     @abstractmethod
#     def run(self, element, context):
#         # TODO: Document me
#         pass
# 
# Path: skema/config.py
# def get_config():
#     global _config
#     if _config is not None:
#         return _config
#     _config = SkemaConfig()
#     return _config


# Path: skema/tag.py
import os
import shutil
from skema.api import SkemaTagIf
from skema.config import get_config

        test specific install that may be needed.
        """
        #if not self.installer:
        #    raise RuntimeError("no installer defined for '%s'" %
        #                        self.tagsdir)

        config = get_config()
        tagsdir = os.path.join(config.tagsdir, self.tagsdir)
        if os.path.exists(tagsdir):
            raise RuntimeError("%s is already installed" % self.tagsdir)
        os.makedirs(tagsdir)
        os.chdir(tagsdir)
        #try:
        #    self.installer.install()
        #except Exception as strerror:
        #    self.uninstall()
        #    raise
        #finally:
        os.chdir(self.origdir)

    def uninstall(self):
        """Uninstall the test tag.

        Uninstalling just recursively removes the test specific directory
        under the user's XDG_DATA_HOME directory.  This will both mark
        the test as removed, and clean up any files that were downloaded
        or installed under that directory.  Dependencies are intentionally
        not removed by this.
        """
        os.chdir(self.origdir)

        config = get_config()