示例#1
0
文件: loader.py 项目: chris-zen/wok
	def load_from_file(self, path):
		reader = FlowReader(path)
		name, library, version = reader.read_meta()
		uri = self.compose_uri(name, library, version)
		if uri in self.__flow_cache:
			return self.__flow_cache[uri]

		flow = reader.read()
		self.__flow_cache[flow] = flow
		return flow
示例#2
0
文件: loader.py 项目: philloidin/wok
	def load_from_file(self, path):
		reader = FlowReader(path)
		name, library, version = reader.read_meta()
		uri = self.compose_uri(name, library, version)
		#FIXME case.py modifies model objects so we cannot cache them
		#if uri in self.__flow_cache:
		#	return self.__flow_cache[uri]

		flow = reader.read()
		self.__flow_cache[uri] = flow
		return flow
示例#3
0
文件: loader.py 项目: chris-zen/wok
	def load_from_uri(self, uri):
		if uri in self.__flow_cache:
			return self.__flow_cache[uri]

		if uri in self.__flow_files:
			reader = FlowReader(self.__flow_files[uri][0])
			flow = reader.read()
			self.__flow_cache[flow] = flow
			return flow

		raise Exception("Flow not found: {}".format(uri))
示例#4
0
文件: loader.py 项目: philloidin/wok
	def load_from_uri(self, uri):
		#FIXME case.py modifies model objects so we cannot cache them
		# if uri in self.__flow_cache:
		#	return self.__flow_cache[uri]

		if uri in self.__flow_files:
			reader = FlowReader(self.__flow_files[uri][0])
			flow = reader.read()
			self.__flow_cache[uri] = flow
			return flow

		raise Exception("Flow not found: {}".format(uri))