Esempio n. 1
0
	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
Esempio n. 2
0
	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
Esempio n. 3
0
	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))
Esempio n. 4
0
	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))