예제 #1
0
def check():
    time_start = time.time()
    error = 0
    total = 0
    cur_dir = os.getcwd()
    stdout, stderr = system.shell([
        'licensecheck',
        '--recursive',
        '--copyright',
        '--ignore',
        'phatch/other|wxGlade|license',
        os.path.abspath('..'),
    ])
    for match in RE_FILE.finditer(stdout):
        d = match.groupdict()
        d['error'] = get_error(d)
        if d['error'] and not ('api.py' in d['filename']):
            print('%(filename)s:\n'\
                '- %(error)s\n'\
                '- license: %(license)s\n'\
                '- copyright: %(copyright)s\n' % d)
            error += 1
        total += 1
    print('Ran %d license tests in %.3fs' % (total, time.time() - time_start))
    sys.exit(error)
예제 #2
0
 def init(self):
     global imtools
     from lib import imtools
     self.find_exe('blender')
     out, err = system.shell((self.exe, '-v'))
     if not RE_BLENDER_VERSION.search(out):
         raise Exception(
             _('Sorry, you have the wrong version of Blender installed.') +
             ' ' + _('Blender %s is required.') % BLENDER_VERSIONS)
예제 #3
0
 def init(self):
     global imtools
     from lib import imtools
     self.find_exe('blender')
     out, err = system.shell((self.exe, '-v'))
     if not RE_BLENDER_VERSION.search(out):
         raise Exception(
             _('Sorry, you have the wrong version of Blender installed.') +
             ' ' + _('Blender %s is required.') % BLENDER_VERSIONS)
예제 #4
0
def check():
    time_start = time.time()
    error = 0
    total = 0
    cur_dir = os.getcwd()
    stdout, stderr = system.shell(
        [
            "licensecheck",
            "--recursive",
            "--copyright",
            "--ignore",
            "phatch/other|wxGlade|license",
            os.path.abspath(".."),
        ]
    )
    for match in RE_FILE.finditer(stdout):
        d = match.groupdict()
        d["error"] = get_error(d)
        if d["error"] and not ("api.py" in d["filename"]):
            print("%(filename)s:\n" "- %(error)s\n" "- license: %(license)s\n" "- copyright: %(copyright)s\n" % d)
            error += 1
        total += 1
    print("Ran %d license tests in %.3fs" % (total, time.time() - time_start))
    sys.exit(error)