def print_capacities(caps): sep = ' | ' sep_line = io.add_space('', 113).replace(' ', '*') print sep_line print '* ' + io.add_space('ID', 3) + sep + io.add_space( 'Name', 20) + sep + io.add_space('Description', 80) + ' *' print sep_line for c in caps: print_capacity(c) print sep_line
def print_u_types(u_types): sep_line = io.add_space('',40).replace(' ', '*') io.cls() print sep_line print '* '+ io.add_space('Types',17) + ' list' + io.add_space('',14) + ' *' print '* ' + ' ID | ' + io.add_space('Unit type', 30) + ' *' print sep_line for ut in u_types: print_u_type(ut) print sep_line return True
def print_weapons(weapons): sep = ' | ' sep_line = io.add_space('', 104).replace(' ', '*') header = '* ' for field in conf.get_conf('weapon.conf')['fields_size'].split(','): header = header + io.add_space(field.split(':')[0], int(field.split(':')[1])) + sep header = header[:-2:] + '*' print sep_line print header print sep_line for weapon in weapons: print_weapon(weapon) print sep_line
def print_codex(codex): sep_line = io.add_space('', 40).replace(' ', '*') io.cls() print sep_line print '* ' + io.add_space('Codex', 17) + ' list' + io.add_space('', 14) + ' *' print '* ' + ' ID | ' + io.add_space('Codex name', 30) + ' *' print sep_line print '' for c in codex: print_codex_item(c) print sep_line return True
def print_units(units): sep = ' | ' star = io.add_space('', 139).replace(' ', '*') header = '* ' for field in conf.get_conf('unit.conf')['unit_display'].split(','): header = header + io.add_space( field.split(':')[0], int(field.split(':')[1])) + sep header = header[:-2:] + '*' print star print header print star for unit in units: print_unit(unit) print star
def print_lists(lists): sep = ' | ' sep_line = io.add_space('', 83).replace(' ', '*') header = '* ' for field in conf.get_conf('list.conf')['display'].split(','): header = header + io.add_space( field.split(':')[0], int(field.split(':')[1])) + sep header = header[:-3:] + '*' print sep_line print header print sep_line for i_list in lists: print_list(i_list) print sep_line
def print_unit(unit): sep = ' | ' u = '* ' for field in conf.get_conf('unit.conf')['unit_display'].split(','): u = u + io.add_space(unit[int(field.split(':')[2])], int(field.split(':')[1])) + sep print u[:-2:] + '*'
def print_list(li): sep = ' | ' p_li = '* ' for field in conf.get_conf('list.conf')['display'].split(','): p_li = p_li + io.add_space(str(li[int(field.split(':')[2])]), int(field.split(':')[1])) + sep print p_li[:-2:] + '*'
def print_capacity(capacity): sep = ' | ' print '* ' + io.add_space(capacity[0], 3) + sep + io.add_space( capacity[1], 20) + sep + io.add_space(capacity[2], 80) + ' *'
def print_u_type(row): print '* ' + io.add_space(str(row[0]), 3) + ' | ' + io.add_space(str(row[1]), 30) + ' *'
def print_weapon(weapon): sep = ' | ' w = '* ' for field in conf.get_conf('weapon.conf')['fields_size'].split(','): w = w + io.add_space(weapon[int(field.split(':')[2])], int(field.split(':')[1])) + sep print w[:-3:] + '*'
def print_codex_item(row): print '* ' + io.add_space(str(row[0]), 3) + ' | ' + io.add_space( str(row[1]), 30) + ' *'