Example #1
	def from_id(cls, method_class, method_id):
		"""Look up Method class based on method_class and method_id numbers."""
		for method in get_all_subclasses(Method):
			if method.method_class == method_class and method.method_id == method_id:
				return method
			raise ValueError("Unknown method for class {} and method_id {}".format(method_class, method_id))
Example #2
	def from_code(cls, code):
		"""Look up error class based on code."""
		for subcls in get_all_subclasses(cls):
			if subcls.code == code:
				return subcls
		raise ValueError("No known subclass for code: {!r}".format(code))
Example #3
	def get_by_class(cls, method_class):
		for subcls in get_all_subclasses(cls):
			if subcls.method_class == method_class:
				return subcls
		raise ValueError("No Properties defined for method class {:x}".format(method_class))