return (not isdir(f)) and access(f, X_OK) MODULE_TYPES = {'python': 'python-module', 'javascript': 'javascript-library', 'ruby': 'ruby-gem'} CAN_BUILD = environ['KROPOTKIN_CAN_BUILD'].split(',') subscribe('kropotkin', 'fact', 'library_available') while True: fact = get_next_fact('kropotkin', 'library_available') original_dir = fact['directory'] language = fact['language'] if language not in CAN_BUILD: print_stdout('Skipping library %s as language %s not buildable' \ % (original_dir, language)) continue build_dir = mkdtemp(prefix='library-build-%s' % basename(original_dir)) output_dir = mkdtemp(prefix='library-%s' % basename(original_dir)) copy_all(original_dir, build_dir) executable = get_unique_executable(build_dir) if not executable: stderr.write("Cannot locate unique executable in %s\n" % build_dir) continue process = Popen([executable, output_dir], cwd=build_dir) process.wait() files = listdir(output_dir) if len(files) != 1:
def store_log_file(component, type_, filename): log_file = LogFile(component, type_, filename) LOG_FILES.add(log_file) print_stdout("Stored %s" % str(log_file))