Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- import sys
- from evennia import ObjectDB, AccountDB
- from evennia import default_cmds
- from evennia.utils import create, evtable, make_iter
- from evennia.comms.models import Msg
- from typeclasses.accounts import Account
- from world.utils import parse_switches, itemize
- class CmdJobs(default_cmds.MuxCommand):
- key = "@jobs"
- lock = "cmd:all()"
- help_category = "Comms"
- switchtab = ("new", "delete", "category", "priority", "assign", "status", "list", "lock", "complete")
- def _create_job():
- pass
- def _delete_job():
- pass
- def do_new(self):
- self.caller.msg("NEW")
- def do_delete(self):
- self.caller.msg("DELETE")
- def do_category(self):
- self.caller.msg("CATEGORY")
- def do_priority(self):
- self.caller.msg("PRIORITY")
- def do_assign(self):
- self.caller.msg("ASSIGN")
- def do_status(self):
- self.caller.msg("STATUS")
- def do_list(self):
- self.caller.msg("LIST")
- def do_lock(self):
- self.caller.msg("LOCK")
- def do_complete(self):
- self.caller.msg("COMPLETE")
- # The actual command handler!
- def func(self):
- # Cache this
- caller = self.caller
- if not self.switches:
- caller.msg("Usage: @jobs[/switch] <args>")
- return
- switch = parse_switches(self):
- if not switch:
- return
- # Lookup the name of the handler based on the switch
- method = getattr(self, "do_%s" % switch)
- # Make sure it exists and is callable
- if method and callable(method):
- # Call it!
- method()
- else:
- # Report the error.
- caller.msg("JOBS: No such handler.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement