示例#1
0
 def post(self):
     q = HelpRequest.query(HelpRequest.in_queue == True,
                           ancestor=help_queue_key()).fetch()
     for hr in q:
         hr.canceled = True
         hr.put()
     ChannelManager.queue_update()
示例#2
0
 def post(self):
     user = users.get_current_user()
     q = HelpRequest.query(HelpRequest.in_queue == True,
                           HelpRequest.netid == self.request.get('email'),
                           ancestor=help_queue_key())
     if q.count() != 1:
         logging.error("Database corrupted for user {}".format(
             user.email()))
         return
     if is_ta(user.email()):
         update_active_tas(user.email())
     hr = q.get()
     hr.canceled = True
     hr.put()
     ChannelManager.queue_update()
示例#3
0
 def post(self):
     user = users.get_current_user()
     q = HelpRequest.query(HelpRequest.in_queue == True,
                           HelpRequest.netid == user.email(),
                           ancestor=help_queue_key())
     if q.count() != 0:
         self.response.write('Unable to add to queue')
         return
     hr = HelpRequest(parent=help_queue_key())
     hr.netid = user.email()
     hr.name = self.request.get('name')
     hr.help_msg = self.request.get('help_msg')
     hr.course = self.request.get('course')
     hr.put()
     ChannelManager.queue_update()
 def post(self):
     user = users.get_current_user()
     q = HelpRequest.query(HelpRequest.in_queue == True,
                           HelpRequest.netid == user.email(),
                           ancestor=help_queue_key())
     if q.count() != 0:
         self.response.write('Unable to add to queue')
         return
     hr = HelpRequest(parent=help_queue_key())
     hr.netid = user.email()
     hr.name = self.request.get('name')
     hr.help_msg = self.request.get('help_msg')
     hr.course = self.request.get('course')
     hr.put()
     ChannelManager.queue_update()
示例#5
0
 def post(self):
     user = users.get_current_user()
     hr = fetch_help_request(requester = self.request.get('email'),
                             full_id   = self.request.get('full_id'))
     if hr:
         update_active_tas(user.email())
         hr.been_helped = True
         hr.helped_datetime = datetime.utcnow()
         hr.attending_ta = user.email()
         hr.put()
         ChannelManager.queue_update()
         ta = LabTA.query(LabTA.email == hr.attending_ta,
                          ancestor=labta_key()).fetch()[0]
         ChannelManager.notify_request_accepted(hr.netid,
                                                ta.first_name,
                                                ta.img_path)
 def __init__(self):
     self.model = ModelManager.ModelManager()
     self.width = 800
     self.height = 600
     self.clientsocket = None
     self.graph = None
     self.channel_manager=ChannelManager.ChannelManager()
     self._getgraph()
示例#7
0
 def __init__(self):
     # 实例化模型管理类
     self.model = ModelManager.ModelManager()
     self.width = 1024
     self.height = 768
     self.clientsocket = None
     self.channel_manager = ChannelManager.ChannelManager()
     self.graph = None
     self._getgraph()
示例#8
0
    def post(self):
        user = users.get_current_user()

        # NOTE: previously this command could be run by anybody; now it
        # is restricted to TAs; consider restricting this further.
        
        if is_ta(user.email()):
          logging.info("User {} cleared the queue".format(user.email()))
          q = HelpRequest.query(HelpRequest.in_queue == True,
                                ancestor=help_queue_key()).fetch()
          for hr in q:
              hr.canceled = True

              # NOTE: same as above, if cancelled by TA, mark it.
              if hr.netid != user.email():
                   hr.attending_ta = user.email()
              
              hr.put()
          ChannelManager.queue_update()
示例#9
0
 def post(self):
     user = users.get_current_user()
     q = HelpRequest.query(HelpRequest.in_queue == True,
                           HelpRequest.netid == self.request.get('email'),
                           ancestor=help_queue_key())
     if q.count() != 1:
         logging.error("Database corrupted for user {}".format(
             user.email()))
         return
     update_active_tas(user.email())
     hr = q.get()
     hr.been_helped = True
     hr.helped_datetime = datetime.utcnow()
     hr.attending_ta = user.email()
     hr.put()
     ChannelManager.queue_update()
     ta = LabTA.query(LabTA.email == hr.attending_ta,
                      ancestor=labta_key()).fetch()[0]
     ChannelManager.notify_request_accepted(hr.netid, ta.first_name,
                                            ta.img_path)
示例#10
0
 def post(self):
     user = users.get_current_user()
     hr = fetch_help_request(requester = self.request.get('email'),
                             full_id   = self.request.get('full_id'))
     if hr:
        hr.canceled = True
        
        if is_ta(user.email()):
            update_active_tas(user.email())
            
            # Update this field if the cancellation comes from the TA
            # and the TA isn't the originator of the request
            #
            # FIXME: there should be a field dedicated to the canceller.
            
            if hr.netid != user.email():
                hr.attending_ta = user.email()
              
        hr.put()
        ChannelManager.queue_update()
示例#11
0
文件: main.py 项目: ramazanovNull/CMO
    def __init__(self):
        Thread.__init__(self)
        self.channel_manager = ChannelManager.ChannelManager(3)
        self.request_generator = RequestGenerator.RequestGenerator(
            self.channel_manager.get_request)
        self.request_generator.start()

        # self.request_generator.start()
        # self.channel_manager.start()

        self.root = Tk()
        btn_create_new_channel = Button(self.root, text='Add channel')
        btn_remove_empty_channel = Button(self.root, text='Remove channel')
        btn_create_new_channel.bind('<Button-1>',
                                    self.channel_manager.add_channel)
        btn_remove_empty_channel.bind('<Button-1>',
                                      self.channel_manager.remove_channel)

        btn_create_new_channel.pack(side='left')
        btn_remove_empty_channel.pack(side='right')

        self.stat_text = StringVar()
        self.lbl = Label(self.root, textvariable=self.stat_text)
        self.lbl.pack(side='top')
    print('clientsocket is None')
    sys.exit(1)

# Create a thread, bind a thread function.
# the thread function will block after establishing a connection
thread_1 = threading.Thread(target=clientsocket.start_connect)
# Set the thread as a background thread.
# After the main thread ends, the background thread will stop regardless of whether it has finished running
thread_1.setDaemon(True)
# Thread function execution, establish a connection
thread_1.start()
# Provide sufficient connection time for data transfer of the main thread
time.sleep(0.1)

# Instantiate Channel Manager
channel_manager = ChannelManager.ChannelManager()
# Get message data
data = channel_manager.OpenChannel()
# Send message data to presenter server
clientsocket.send_data(data)

cap = cv2.VideoCapture(URL)
ret, frame = cap.read()

# According to the flag,Perform different processing methods
if mp4_url:
    try:
        while ret:
            # Processing the detection results of a frame of pictures
            ret = Head_pose_inference.dowork(frame, clientsocket,
                                             channel_manager, face_app,