Ejemplo n.º 1
0
Archivo: _opts.py Proyecto: fdev31/pyg
def freeze_func(args):
    f = freeze()
    if args_manager['freeze']['count']:
        sys.stdout.write(str(len(freeze())) + '\n')
        return
    f = '\n'.join(f) + '\n'
    if args_manager['freeze']['file']:
        path = args.file or args_manager['freeze']['file']
        with open(os.path.abspath(path), 'w') as req_file:
            req_file.write(f)
    return sys.stdout.write(f)
Ejemplo n.º 2
0
Archivo: _opts.py Proyecto: Malex/pyg
def site_func(count, no_info, file):
    f = freeze()
    if count:
        sys.stdout.write(str(len(f)) + '\n')
        return
    f = '\n'.join(f) + '\n'
    if not no_info:
        f = site_info() + f
    if file:
        with open(os.path.abspath(file), 'w') as req_file:
            req_file.write(f)
    return sys.stdout.write(f)