Example #1
0
def scan(cfg):
    print("Scanning...")
    files = collections.deque()
    ignored_paths = cfg.get("ignore_path", [])
    files_ignored = 0
    file_iter = utils.find_files(cfg.get("paths", []), cfg.get("extension", []), ignored_paths)
    default_extension = cfg.get("default_extension")
    file_encoding = cfg.get("file_encoding")
    for filename, ignoreable in file_iter:
        if ignoreable:
            files_ignored += 1
            if cfg.get("verbose"):
                print("  Ignoring '%s'" % (filename))
        else:
            f = file_parser.parse(filename, default_extension=default_extension, encoding=file_encoding)
            files.append(f)
            if cfg.get("verbose"):
                print("  Selecting '%s'" % (filename))
    return (files, files_ignored)
Example #2
0
def scan(cfg):
    print("Scanning...")
    files = collections.deque()
    ignored_paths = cfg.get('ignore_path', [])
    files_ignored = 0
    file_iter = utils.find_files(cfg.get('paths', []),
                                 cfg.get('extension', []), ignored_paths)
    default_extension = cfg.get('default_extension')
    file_encoding = cfg.get('file_encoding')
    for filename, ignoreable in file_iter:
        if ignoreable:
            files_ignored += 1
            if cfg.get('verbose'):
                print("  Ignoring '%s'" % (filename))
        else:
            f = file_parser.parse(filename,
                                  default_extension=default_extension,
                                  encoding=file_encoding)
            files.append(f)
            if cfg.get('verbose'):
                print("  Selecting '%s'" % (filename))
    return (files, files_ignored)
Example #3
0
def scan(cfg):
    if not cfg.get("quiet"):
        print("Scanning...")
    files = collections.deque()
    ignored_paths = cfg.get("ignore_path", [])
    files_ignored = 0
    file_iter = utils.find_files(cfg.get("paths", []),
                                 cfg.get("extension", []), ignored_paths)
    default_extension = cfg.get("default_extension")
    file_encoding = cfg.get("file_encoding")
    for filename, ignoreable in file_iter:
        if ignoreable:
            files_ignored += 1
            if cfg.get("verbose"):
                print("  Ignoring '%s'" % (filename))
        else:
            f = file_parser.parse(filename,
                                  default_extension=default_extension,
                                  encoding=file_encoding)
            files.append(f)
            if cfg.get("verbose"):
                print("  Selecting '%s'" % (filename))
    return (files, files_ignored)
Example #4
0
def scan(cfg):
    if not cfg.get('quiet'):
        print("Scanning...")
    files = collections.deque()
    ignored_paths = cfg.get('ignore_path', [])
    files_ignored = 0
    file_iter = utils.find_files(cfg.get('paths', []),
                                 cfg.get('extension', []), ignored_paths)
    default_extension = cfg.get('default_extension')
    file_encoding = cfg.get('file_encoding')
    for filename, ignoreable in file_iter:
        if ignoreable:
            files_ignored += 1
            if cfg.get('verbose'):
                print("  Ignoring '%s'" % (filename))
        else:
            f = file_parser.parse(filename,
                                  default_extension=default_extension,
                                  encoding=file_encoding)
            files.append(f)
            if cfg.get('verbose'):
                print("  Selecting '%s'" % (filename))
    return (files, files_ignored)