@@ -0,0 +1,2688 @@
+#-*- coding: utf-8 -*-%0A%22%22%22%0Arunner%0A------%0AA module containing application and daemon process utilities.%0A%0A@author Isis Agora Lovecruft %3Cisis@leap.se%3E, 0x2cdb8b35%0A@version 0.0.1%0A%0A%22%22%22%0A%0Afrom os import path as ospath%0A%0Aimport re%0A%0A%0Aclass CheckRequirements(ImportError):%0A    %22%22%22%0A    Raised when we're missing something from requirements.pip.%0A    %22%22%22%0A    def __init__(self, package_name, pipfile, message=None):%0A        %22%22%22%0A        Display an error message with instructions for obtaining missing%0A        dependencies.%0A%0A        @param message: A string describing the error.%0A        @param missing: A string indicating which dependency is missing.%0A        @param pipfile: The path and filename of the pip requirements file,%0A            relative to the top-level repository directory.%0A        %22%22%22%0A        if message:%0A            self.message = message%0A            return self%0A%0A        self.package_name = package_name%0A        self.pipfile      = pipfile%0A        self.dependencies = self.__read_pip_requirements__()%0A        self.missing      = %5B%5D%0A%0A        for package, version in self.dependencies:%0A            pkg = package.lower() if package == %22Twisted%22 else package%0A            try:%0A                __import__(pkg)%0A            except ImportError:%0A                self.missing.append(package)%0A%0A        if len(self.missing) %3E 0:%0A            self.message = self.package_name + %22 requires %22%0A        elif len(self.missing) %3C= 0:%0A            return None%0A%0A        if len(self.missing) %3E= 1:%0A            for missed in self.missing%5B:-1%5D:%0A                self.message += missed + %22, %22%0A            self.message += %22and %22%0A%0A        if len(self.missing) == 1:%0A            self.message += self.missing%5B0%5D + %22.%22%0A            self.message += %22%5CnPlease see %25s for %22.format(self.pipfile)%0A            self.message += %22instruction on installing dependencies.%22%0A            raise self(self.message)%0A%0A    def __read_pip_requirements__(self, file=None):%0A        %22%22%22%0A        Check the pip requirements file to determine our dependencies.%0A%0A        @param file: The full path of the pip requirements.txt file.%0A        @returns: A list of tuple(package_name, package_version).%0A        %22%22%22%0A        if not file:%0A            file = self.pipfile%0A%0A        requirement  = re.compile('%5B%5E0-9=%3E%3C%5D+')%0A        dependencies = %5B%5D%0A%0A        with open(file) as pipfile:%0A            for line in pipfile.readlines():%0A                shortened       = line.strip()%0A                matched         = requirement.match(shortened)%0A                package_name    = matched.group()%0A                package_version = shortened.split(package_name, 1)%5B1%5D%0A                dependencies.append((package_name, package_version))%0A        return dependencies%0A

Add new version of leap/mx/util/runner.py file.