예제 #1
0
파일: support.py 프로젝트: DroneD/droned
def grab(conversation, id):
  id = int(id)
  issue = Issue.byID(id)

  if not issue:
    conversation.say("There is no issue with the ID %d" % id)
  elif not issue.hasSOP:
    conversation.say("Unfortunately that issue doesn't have an SOP associated with it. "
                     "All I can do is describe the problem to you and wait for you to "
                     "<b>resolve<b> it manually")
    conversation.say(issue.description)
    contextSummary = '\n'.join("%s: %s" % info for info in issue.context.data.items())
    conversation.say(contextSummary, useHTML=False)
  else:
    existingAgent = issue.context['agent']

    if existingAgent:
      if existingAgent.conversation is conversation:
        conversation.say("You are already troubleshooting this issue!")
        return
      existingAgent.conversation.say("<b>%s has taken over this issue.</b>" % conversation.buddyName)
      existingAgent.currentIssue = None
      existingAgent.conversation.nevermind()

    conversation.say("Ok, I am assigning issue #%d to you." % id)
    agent = SupportAgent(conversation.buddy)
    #Make sure the agent is available first
    agent.ready = True
    agent.currentIssue = None
    agent.conversation.nevermind()

    agent.engage(issue)
예제 #2
0
def grab(conversation, id):
    id = int(id)
    issue = Issue.byID(id)

    if not issue:
        conversation.say("There is no issue with the ID %d" % id)
    elif not issue.hasSOP:
        conversation.say(
            "Unfortunately that issue doesn't have an SOP associated with it. "
            "All I can do is describe the problem to you and wait for you to "
            "<b>resolve<b> it manually")
        conversation.say(issue.description)
        contextSummary = '\n'.join("%s: %s" % info
                                   for info in issue.context.data.items())
        conversation.say(contextSummary, useHTML=False)
    else:
        existingAgent = issue.context['agent']

        if existingAgent:
            if existingAgent.conversation is conversation:
                conversation.say("You are already troubleshooting this issue!")
                return
            existingAgent.conversation.say(
                "<b>%s has taken over this issue.</b>" %
                conversation.buddyName)
            existingAgent.currentIssue = None
            existingAgent.conversation.nevermind()

        conversation.say("Ok, I am assigning issue #%d to you." % id)
        agent = SupportAgent(conversation.buddy)
        #Make sure the agent is available first
        agent.ready = True
        agent.currentIssue = None
        agent.conversation.nevermind()

        agent.engage(issue)
예제 #3
0
def free(conversation):
    agent = SupportAgent(conversation.buddy)
    agent.ready = True
    conversation.say("Ok, I will bug you with support issues.")
예제 #4
0
def busy(conversation):
    agent = SupportAgent(conversation.buddy)
    agent.ready = False
    conversation.say("Ok I won't bug you with support issues.")
예제 #5
0
파일: support.py 프로젝트: DroneD/droned
def free(conversation):
  agent = SupportAgent( conversation.buddy )
  agent.ready = True
  conversation.say("Ok, I will bug you with support issues.")
예제 #6
0
파일: support.py 프로젝트: DroneD/droned
def busy(conversation):
  agent = SupportAgent( conversation.buddy )
  agent.ready = False
  conversation.say("Ok I won't bug you with support issues.")