當前位置: 首頁>>代碼示例>>Python>>正文


Python filter.FileFilter類代碼示例

本文整理匯總了Python中filter.FileFilter的典型用法代碼示例。如果您正苦於以下問題:Python FileFilter類的具體用法?Python FileFilter怎麽用?Python FileFilter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了FileFilter類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		## The time of the last modification of the file.
		self.__lastModTime = dict()
		self.__file404Cnt = dict()
		logSys.debug("Created FilterPoll")
開發者ID:Th4nat0s,項目名稱:fail2ban,代碼行數:7,代碼來源:filterpoll.py

示例2: __init__

	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		# Pyinotify watch manager
		self.__monitor = pyinotify.WatchManager()
		self.__watches = dict()
		logSys.debug("Created FilterPyinotify")
開發者ID:bfx,項目名稱:fail2ban,代碼行數:7,代碼來源:filterpyinotify.py

示例3: delLogPath

	def delLogPath(self, path):
		if not self.containsLogPath(path):
			logSys.error(path + " is not monitored")
		else:
			del self.__lastModTime[path]
			del self.__file404Cnt[path]
			FileFilter.delLogPath(self, path)
			logSys.info("Removed logfile = %s" % path)
開發者ID:Th4nat0s,項目名稱:fail2ban,代碼行數:8,代碼來源:filterpoll.py

示例4: addLogPath

	def addLogPath(self, path, tail = False):
		if self.containsLogPath(path):
			logSys.error(path + " already exists")
		else:
			self.__lastModTime[path] = 0
			self.__file404Cnt[path] = 0
			FileFilter.addLogPath(self, path, tail)
			logSys.info("Added logfile = %s" % path)	
開發者ID:Th4nat0s,項目名稱:fail2ban,代碼行數:8,代碼來源:filterpoll.py

示例5: addLogPath

	def addLogPath(self, path, tail=False):
		if self.containsLogPath(path):
			logSys.error(path + " already exists")
		else:
			wd = self.__monitor.add_watch(path, pyinotify.IN_MODIFY)
			self.__watches.update(wd)
			FileFilter.addLogPath(self, path, tail)
			logSys.info("Added logfile = %s" % path)
開發者ID:Th4nat0s,項目名稱:fail2ban,代碼行數:8,代碼來源:filterpyinotify.py

示例6: __init__

    def __init__(self, jail, **kwargs):
        FileFilter.__init__(self, jail, **kwargs)

        #Initially we set the classifier equal to null
        self.__fail_classifiers = list()
        ## The ip siever:
       	self.__ip_sieve = IPSieve()
        self._build_available_feature_list()
開發者ID:CyberIntelMafia,項目名稱:fail2ban,代碼行數:8,代碼來源:ai_filter.py

示例7: __init__

	def __init__(self, jail):
		FileFilter.__init__(self, jail)
		self.__modified = False
		# Gamin monitor
		self.monitor = gamin.WatchMonitor()
		fd = self.monitor.get_fd()
		flags = fcntl.fcntl(fd, fcntl.F_GETFD)
		fcntl.fcntl(fd, fcntl.F_SETFD, flags|fcntl.FD_CLOEXEC)
		logSys.debug("Created FilterGamin")
開發者ID:Jamyn,項目名稱:fail2ban,代碼行數:9,代碼來源:filtergamin.py

示例8: delLogPath

	def delLogPath(self, path):
		if not self.containsLogPath(path):
			logSys.error(path + " is not monitored")
		else:
			wdInt = self.__watches[path]
			wd = self.__monitor.rm_watch(wdInt)
			if wd[wdInt]:
				del self.__watches[path]
				FileFilter.delLogPath(self, path)
				logSys.info("Removed logfile = %s" % path)
			else:
				logSys.error("Failed to remove watch on path: %s", path)
開發者ID:Th4nat0s,項目名稱:fail2ban,代碼行數:12,代碼來源:filterpyinotify.py


注:本文中的filter.FileFilter類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。