Exemplo n.º 1
0
            formedRegex = utils.extensionify(extensions
                                             or utils.DEFAULT_EXTENSIONS_REGEX)
            extCompile = utils.regexCompile(formedRegex)

        except ValueError:
            utils.streamPrintFlush("Recursion depth must be an integer\n",
                                   sys.stderr)
        except KeyboardInterrupt:
            utils.streamPrintFlush("Ctrl-C applied. Exiting now..\n",
                                   sys.stderr)
            break
        except Exception:
            continue
        else:
            if not baseUrl:
                continue

            if extCompile:
                getFiles(baseUrl, extCompile, rDepth)

    utils.streamPrintFlush("Bye..\n", sys.stderr)


if __name__ == '__main__':
    try:
        main()
    except Exception:
        pass
    finally:
        utils.showStats(startTimeSecs, hitsDict, missesDict)
Exemplo n.º 2
0
      if eofState: break
      
      rDepth = int(lineIn.strip("\n"))

      formedRegex =\
             "\.(%s)"%(extensions) if extensions else DEFAULT_EXTENSIONS_REGEX

      extCompile = regexCompile(formedRegex)

    except ValueError:
      streamPrintFlush("Recursion depth must be an integer\n", sys.stderr)
    except KeyboardInterrupt:
      streamPrintFlush("Ctrl-C applied. Exiting now..\n",sys.stderr)
      break
    except Exception:
      continue
    else:
      if not baseUrl:
        continue

      if extCompile:
        getFiles(baseUrl, extCompile, rDepth)

  streamPrintFlush("Bye..\n",sys.stderr)
if __name__ == '__main__':
  try:
    main()
  except Exception:
    pass
  showStats(startTimeSecs, hitsDict, missesDict)
Exemplo n.º 3
0
      lineIn, eofState = readFromStream()
      if eofState: break
      
      rDepth = int(lineIn.strip("\n"))

      formedRegex = utils.extensionify(extensions or utils.DEFAULT_EXTENSIONS_REGEX)
      extCompile = utils.regexCompile(formedRegex)

    except ValueError:
      utils.streamPrintFlush("Recursion depth must be an integer\n", sys.stderr)
    except KeyboardInterrupt:
      utils.streamPrintFlush("Ctrl-C applied. Exiting now..\n",sys.stderr)
      break
    except Exception:
      continue
    else:
      if not baseUrl:
        continue

      if extCompile:
        getFiles(baseUrl, extCompile, rDepth)

  utils.streamPrintFlush("Bye..\n",sys.stderr)
if __name__ == '__main__':
  try:
    main()
  except Exception:
    pass
  finally:
    utils.showStats(startTimeSecs, hitsDict, missesDict)