Esempio n. 1
0
def main(args):
    config = configlib.load_config(args.config)
    shell = shells.SHELLS[args.shell]
    print(shell.command_separator.join((
        shell.unset_variable('WINEPREFIX'),
        shell.unset_variable('WINEARCH'),
        shell.export_variable('LANG', config['DEFAULT']['lang']),
    )))
Esempio n. 2
0
def main(args):
    config = configlib.load_config(args.config)
    name = args.name
    if not config.has_section(name):
        logger.error("%s environment doesn't exist", name)
        sys.exit(1)
    shell = shells.SHELLS[args.shell]
    print(shell.command_separator.join((
        shell.export_variable(var, value)
        for var, value in load_vars(config[name])
    )))
Esempio n. 3
0
def main(args):
    config = configlib.load_config(args.config)
    if args.verbose:
        sections = []
        for section in config.sections():
            lines = []
            lines.append(section)
            for key in _KEYS:
                lines.append('{}={}'.format(key, config[section][key]))
            sections.append('\n'.join(lines))
        print('\n\n'.join(sections))
    else:
        for section in config.sections():
            print(section)
Esempio n. 4
0
def main(args):
    config = configlib.load_config(args.config)
    name = args.name
    if name not in config:
        config.add_section(name)
    if args.prefix is None:
        args.prefix = os.path.join(os.environ['HOME'], '.local', 'share',
                                   'wineprefixes', args.name)
    config[name]['prefix'] = args.prefix
    if args.arch is not None:
        config[name]['arch'] = args.arch
    if args.lang is not None:
        config[name]['lang'] = args.lang
    configlib.save_config(config, args.config)