コード例 #1
0
ファイル: coverage.py プロジェクト: mattorb/Ale
    def execute(self, args=None):
        prevCwd = os.getcwd()
        noseroot = join(join(join(alePath('recipes_installed'), 'test'), 'pkgs'), 'nose-0.11.0')
        coverageroot = join(join(join(alePath('recipes_installed'), 'test'), 'pkgs'), 'coverage-3.2b3')

        command = join(join(noseroot, 'bin/'), 'nosetests')

        args = [] if not args else args
        args += [
            '--with-coverage',
            '--cover-erase',
            '--cover-inclusive',
            '--cover-exclude-package',
            'pickle,mimetypes,quopri,weakref,facebook,appengine_utilities,django,email,encodings,xml,yaml,ctypes,json,lib,codeop,hmac,sha,sgmllib,uuid,mockito,simplejson,subprocess,smtplib,uu,md5,markupbase,icalendar,hashlib,gzip,getpass,_strptime,nose,webob,urllib,google,ssl,wsgiref,urlparse,rfc822,mimetools,httplib,dummy_thread,cgi,calendar,base64,Cookie'
                ,
            '-m',
            'test',
            '-e',
            'lib.*',
            '-e',
            ".*\.ale.*",
            ]

        fullcommandwithargs = [command] + args
        relcommandwithargs = [relpath(command)] + args

        logging.info('Executing %s' % relcommandwithargs)

        pythonpath = ':'.join([noseroot, coverageroot] + getGaeLibs())

        p = Popen(fullcommandwithargs, env={'PYTHONPATH': pythonpath, 'PATH': os.environ['PATH']})
        sts = os.waitpid(p.pid, 0)[1]

        return sts
コード例 #2
0
ファイル: install.py プロジェクト: mattorb/Ale
    def execute(self, args=None):
        if not args:
            logging.error('specify a command to install.')
            return
        command = args[0]
        sourceTree = os.path.join(recipes_allroot, command)
        destinationTree = os.path.join(recipes_installedroot, command)
        logging.info('Installing from %s to %s' % (relpath(sourceTree), relpath(destinationTree)))

        if os.path.exists(destinationTree):
            logging.error('%s is already recipes_installed.   To re-install, "ale remove %s" first. ' % (command,
                          command))
            return 1

        shutil.copytree(sourceTree, destinationTree)

        instance = getCommandInstance(command)

        if hasattr(instance, 'install'):
            instance.install()

        return 0  # error count (0=success).
コード例 #3
0
ファイル: cleanpyc.py プロジェクト: mattorb/Ale
 def execute(self, args=None):
     command = 'find . -name *.pyc -exec rm {} \;'
     logging.info('Removing all .pyc files (Executing command: "%s")' % relpath(command))
     return os.system(command)