当前位置: 首页>>代码示例>>Python>>正文


Python FileSystem.uncache方法代码示例

本文整理汇总了Python中FileSystem.FileSystem.uncache方法的典型用法代码示例。如果您正苦于以下问题:Python FileSystem.uncache方法的具体用法?Python FileSystem.uncache怎么用?Python FileSystem.uncache使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FileSystem.FileSystem的用法示例。


在下文中一共展示了FileSystem.uncache方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from FileSystem import FileSystem [as 别名]
# 或者: from FileSystem.FileSystem import uncache [as 别名]

#.........这里部分代码省略.........
		file = open(self.logFile,"a");
		if (file != None):
			date = strftime(self.dateFormat,localtime(timestamp));
			if (date != self.lastLogDate):
				file.write("[Date: "+date+"]\r\n");
				self.lastLogDate = date;
			
			if (includeTime):
				file.write("["+strftime(self.timeFormat,localtime(timestamp))+"] "+text+"\r\n");
			else:
				file.write(text+"\r\n");
	
	def output(self, text, log = 1):
		""" Outputs a line to the console. """
		timestamp = time();
		date = strftime(self.dateFormat,localtime(timestamp));
		if (date != self.lastDate):
			print "\n[Date: "+date+"]";
			self.lastDate = date;
		print "["+strftime(self.timeFormat,localtime(timestamp))+"] "+text;
		if (log):
			self.log(text,timestamp);
	
	def adjustDate(self, timestamp = time()):
		""" Adjusts the current date. By default, uses the current time on the system. """
		date = strftime(self.dateFormat,localtime(timestamp));
		self.lastDate = date;
		self.lastLogDate = date;
	
	def send(self, command):
		""" Sends a command to the interpreter, usually from input. """
		self.log("> "+command,time());
		lowerCommand = command.lower();
		prefixSuffix = getSuffixFromList(command,lowerCommand,("reloadresponse","reloadresponseindex","quit","connect","disconnect","join","part","kick","mode","msg","desc","uncache","listusers","setvar","getvar","raw"));
		if (prefixSuffix != None):
			if (prefixSuffix[0] == "reloadresponse"):
				# reload response script
				if (len(prefixSuffix) > 1):
					self.output("Reloading response script '"+prefixSuffix[1]+"'...");
					self.responseSystem.refreshScript(prefixSuffix[1]);
				else:
					self.output("Not enough parameters. Format: reloadresponse [script]");
			elif (prefixSuffix[0] == "reloadresponseindex"):
				self.output("Reloading response index...");
				self.responseSystem.refreshIndex();
			elif (prefixSuffix[0] == "quit"):
				# quit out
				if (self.connection != None and (self.connection.connected or self.connection.connecting)):
					self.connection.disconnect(prefixSuffix[1]);
					sleep(0.25);
				self.output("Goodbye, son.");
				self.active = 0;
			elif (prefixSuffix[0] == "connect"):
				# connect to server
				if (self.connection == None):
					self.createConnection();
				if (not self.connection.connected):
					self.createConnection();
					self.threads["connect"] = Thread(target=self.connection.IRCConnect);
					self.threads["connect"].setDaemon(1);
					self.threads["connect"].start();
				else:
					self.output("Already connected to server.");
			elif (prefixSuffix[0] == "disconnect"):
				if (self.connection != None and (self.connection.connected or self.connection.connecting)):
					self.connection.disconnect(prefixSuffix[1]);
开发者ID:mbkloster,项目名称:platopus,代码行数:70,代码来源:Console.py


注:本文中的FileSystem.FileSystem.uncache方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。