Ejemplo n.º 1
0
	def check(self, args):
		try:
			if args[0] == "module":
				try:
					self.modadd = importlib.import_module("modules."+args[1])
					print(colors.green+"module found"+colors.end)
					check_module(self.modadd)
					print(colors.green+"\ntest passed"+colors.end)

				except IndexError:
					print(colors.red + "Please enter module name!"+ colors.end)

				except ImportError:
					print(colors.red+"Error: module not found!"+colors.end)

				except:
					print(colors.red + "error:\n")
					traceback.print_exc(file=sys.stdout)
					print(colors.end)
			else:
				raise UnknownCommand("Unknown command!")
		except IndexError:
			raise UnknownCommand("Unkown command!")
Ejemplo n.º 2
0
	def check(self, args):
		try:
			if args[0] == "module":
				try:
					self.modadd = importlib.import_module("modules."+args[1])
					print(colors.green+"module found"+colors.end)
					check_module(self.modadd)
					print(colors.green+"\ntest passed"+colors.end)

				except IndexError:
					print(colors.red + "please enter module name"+ colors.end)

				except ImportError:
					print(colors.red+"error: module not found"+colors.end)

				except:
					print(colors.red + "error:\n")
					traceback.print_exc(file=sys.stdout)
					print(colors.end)
			else:
				raise UnknownCommand("unknown command")
		except IndexError:
			raise UnknownCommand("unkown command")