def find_compiler(c): w = Wandbox() r = w.get_compiler_list() for d in r: if d['language'] == 'C++' and d['name'] == c: return True return False
def listup_compiler(verbose): w = Wandbox() r = w.get_compiler_list() for d in r: if d['language'] == 'C++': if verbose: print(d['name'] + ' (' + d['version'] + ')') else: print(d['name'])
def get_default_options(compiler): w = Wandbox() r = w.get_compiler_list() opt = [] for d in r: if d['name'] == compiler: if 'switches' in d: switches = d['switches'] for s in switches: if 'name' in s: if s['default']: opt.append(s['name']) elif 'options' in s: opt.append(s['default']) return opt
def listup_options(compiler): w = Wandbox() r = w.get_compiler_list() for d in r: if d['name'] == compiler: if 'switches' in d: switches = d['switches'] for s in switches: if 'name' in s: if s['default']: print(s['name'] + ' (default)') else: print(s['name']) elif 'options' in s: print(s['default'] + ' (default)') for o in s['options']: print(' ' + o['name'])
#!/usr/bin/env python # # wandbox-listup-compiler.py # import json from wandbox import Wandbox if __name__ == '__main__': w = Wandbox() r = w.get_compiler_list() for d in r: print('{0}: {1}'.format(d['language'], d['name']))