Ejemplo n.º 1
0
def cmd_unignore(currentServer, currentTab, args):
	"""
		Unignores a user pattern.

		Usage: /unignore <pattern>
	"""
	if not args:
		return gui.myPrint("Usage: /unignore <pattern>")
	if not currentServer:
		return gui.myPrint("Could not determine server")

	sushi.unignore(currentServer.name, args[0])
	gui.mgmt.myPrint(_("Unignoring %(user)s.") % {"user":args[0]} )
Ejemplo n.º 2
0
def cmd_invoke_test(currentServer, currentTab, args):
	"""
		Loads a test file and executes it.

		Usage: /invoke_test <path>
	"""
	if len(args) != 1:
		return gui.myPrint("Usage: /invoke_test <path>")

	import os
	import imp

	path, file = os.path.split(args[0])

	name = file.split(".")[0]

	try:
		mod_info = imp.find_module(name, [path])
		test_module = imp.load_module(name, *mod_info)

	except ImportError as e:
		gui.mgmt.myPrint("invoke_test failed: %s" % (e))
		return

	try:
		test_module.start_test(gui)
	except Exception as e:
		gui.mgmt.myPrint("invoke_test run failed: %s\n%s" % (e,
						traceback.format_exc()))
		return
Ejemplo n.º 3
0
def cmd_ignores(currentServer, currentTab, args):
	"""
		Shows all ignored users.

		Usage: /ignores
	"""
	if not currentServer:
		return gui.myPrint("Could not determine server")
	ignores = sushi.ignores(currentServer.name)

	if not ignores:
		gui.mgmt.myPrint(_("No users are ignored on this server."))
	else:
		gui.mgmt.myPrint(_("The following users are ignored: %(ulist)s.") % {
			"ulist": ", ".join(ignores)} )