# Path: pyp2rpm/exceptions.py
# class VirtualenvFailException(BaseException):
#     pass
# 
# Path: pyp2rpm/settings.py
# DEFAULT_PYTHON_VERSION = DEFAULT_PYTHON_VERSIONS[DEFAULT_TEMPLATE][0]
# 
# MODULE_SUFFIXES = ('.py', '.pyc')


import os
import glob
import logging
import pprint
import virtualenvapi.exceptions as ve
from virtualenvapi.manage import VirtualEnvironment
from pyp2rpm.exceptions import VirtualenvFailException
from pyp2rpm.settings import DEFAULT_PYTHON_VERSION, MODULE_SUFFIXES

    def fill(self, path):
        '''
        Scans content of directories
        '''
        self.bindir = set(os.listdir(path + 'bin/'))
        self.lib_sitepackages = set(os.listdir(glob.glob(
            path + 'lib/python*.*/site-packages/')[0]))

    def __sub__(self, other):
        '''
        Makes differance of DirsContents objects attributes
        '''
        if any([self.bindir is None, self.lib_sitepackages is None,
                other.bindir is None, other.lib_sitepackages is None]):
            raise ValueError("Some of the attributes is uninicialized")
        result = DirsContent(
            self.bindir - other.bindir,
            self.lib_sitepackages - other.lib_sitepackages)
        return result


class VirtualEnv(object):

    def __init__(self, name, temp_dir, name_convertor,
                 base_python_version):
        self.name = name
        self.temp_dir = temp_dir
        self.name_convertor = name_convertor
        if not base_python_version:

# Path: pyp2rpm/exceptions.py
# class VirtualenvFailException(BaseException):
#     pass
# 
# Path: pyp2rpm/settings.py
# DEFAULT_PYTHON_VERSION = DEFAULT_PYTHON_VERSIONS[DEFAULT_TEMPLATE][0]
# 
# MODULE_SUFFIXES = ('.py', '.pyc')


# Path: pyp2rpm/virtualenv.py
import os
import glob
import logging
import pprint
import virtualenvapi.exceptions as ve
from virtualenvapi.manage import VirtualEnvironment
from pyp2rpm.exceptions import VirtualenvFailException
from pyp2rpm.settings import DEFAULT_PYTHON_VERSION, MODULE_SUFFIXES


    def fill(self, path):
        '''
        Scans content of directories
        '''
        self.bindir = set(os.listdir(path + 'bin/'))
        self.lib_sitepackages = set(os.listdir(glob.glob(
            path + 'lib/python*.*/site-packages/')[0]))

    def __sub__(self, other):
        '''
        Makes differance of DirsContents objects attributes
        '''
        if any([self.bindir is None, self.lib_sitepackages is None,
                other.bindir is None, other.lib_sitepackages is None]):
            raise ValueError("Some of the attributes is uninicialized")
        result = DirsContent(
            self.bindir - other.bindir,
            self.lib_sitepackages - other.lib_sitepackages)
        return result


class VirtualEnv(object):

    def __init__(self, name, temp_dir, name_convertor,
                 base_python_version):
        self.name = name
        self.temp_dir = temp_dir
        self.name_convertor = name_convertor
        if not base_python_version:

            base_python_version = DEFAULT_PYTHON_VERSION