# Path: redsolutioncms/loader.py
# def install_in_home():
# def run_cmd(cmd, cmd_dict=None):
# def process_cmd_string(cmd, cmd_dict=None):
# def run_in_home(cmd):
# def main():


import os
import shutil
        import warnings
        import warnings
        import warnings
from os.path import abspath, join, dirname, isdir, isfile, exists
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_syncdb
from redsolutioncms.loader import home_dir, project_dir
            src_file.close()
        
    def copy_dir(self, dst, src, merge=True):
        '''
        Copy whole dir recursively.
        When merge=True, target directory will not be deleted,
        othwerwise, it will.
        '''
        if exists(dst):
            if isdir(dst):
                if not merge:
                    shutil.rmtree(dst)
                    shutil.copytree(src, dst)
                else:
                    merge_dirs(src, dst)
            else:
                raise IOError('Error: ``dst`` is not dir')
        else:
            shutil.copytree(src, dst)

    def package_was_installed(self, package_name):
        return package_name in self.installed_packages

    @property
    def installed_packages(self):
        return self.packages.installed().values_list('package', flat=True)

    @property
    def project_dir(self):
        warnings.warn('Project dir is deprecated attribute. Use redsolutioncms.loader.project_dir instead')

# Path: redsolutioncms/loader.py
# def install_in_home():
# def run_cmd(cmd, cmd_dict=None):
# def process_cmd_string(cmd, cmd_dict=None):
# def run_in_home(cmd):
# def main():


# Path: redsolutioncms/models.py
import os
import shutil
        import warnings
        import warnings
        import warnings
from os.path import abspath, join, dirname, isdir, isfile, exists
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.template.loader import render_to_string
from django.core.exceptions import ObjectDoesNotExist
from django.db.models.signals import post_syncdb
from redsolutioncms.loader import home_dir, project_dir

            src_file.close()
        
    def copy_dir(self, dst, src, merge=True):
        '''
        Copy whole dir recursively.
        When merge=True, target directory will not be deleted,
        othwerwise, it will.
        '''
        if exists(dst):
            if isdir(dst):
                if not merge:
                    shutil.rmtree(dst)
                    shutil.copytree(src, dst)
                else:
                    merge_dirs(src, dst)
            else:
                raise IOError('Error: ``dst`` is not dir')
        else:
            shutil.copytree(src, dst)

    def package_was_installed(self, package_name):
        return package_name in self.installed_packages

    @property
    def installed_packages(self):
        return self.packages.installed().values_list('package', flat=True)

    @property
    def project_dir(self):
        warnings.warn('Project dir is deprecated attribute. Use redsolutioncms.loader.project_dir instead')

        return project_dir