def processFiles(self):
     log = logging.getLogger(self.logName);
     log.debug(">> process");
     
     for path in OptionHandler.getArgList()[1:]:
         log.info("path: \"%s\"." % path);
         if not OptionHandler.getOptionActive("followSymlink") and os.path.islink(path):
             log.info("skipping path - is symlink and followSymlink is off.");
             continue;
         
         if os.path.isdir(path):
             for root, dirs, files in os.walk(path):
                 if not OptionHandler.getOptionActive("followSymlink"):
                     filter(lambda d: not os.path.islink(d), dirs);
                     filter(lambda f: not os.path.islink(f), files);
                 
                 for file in files:
                     self.processFile(root, file);
                 
         elif os.path.isfile(path):
             self.processFile("./", path);
     log.debug("<< process");
示例#2
0
    def processFiles(self):
        log = logging.getLogger(self.logName)
        log.debug(">> process")

        for path in OptionHandler.getArgList()[1:]:
            log.info("path: \"%s\"." % path)
            if not OptionHandler.getOptionActive(
                    "followSymlink") and os.path.islink(path):
                log.info(
                    "skipping path - is symlink and followSymlink is off.")
                continue

            if os.path.isdir(path):
                for root, dirs, files in os.walk(path):
                    if not OptionHandler.getOptionActive("followSymlink"):
                        filter(lambda d: not os.path.islink(d), dirs)
                        filter(lambda f: not os.path.islink(f), files)

                    for file in files:
                        self.processFile(root, file)

            elif os.path.isfile(path):
                self.processFile("./", path)
        log.debug("<< process")