Beispiel #1
0
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)
Beispiel #2
0
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)