當前位置: 首頁>>代碼示例>>Python>>正文


Python Queue.all方法代碼示例

本文整理匯總了Python中model.queues.Queue.all方法的典型用法代碼示例。如果您正苦於以下問題:Python Queue.all方法的具體用法?Python Queue.all怎麽用?Python Queue.all使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在model.queues.Queue的用法示例。


在下文中一共展示了Queue.all方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _queue_from_request

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
 def _queue_from_request(self):
     queue_name = self.request.get("queue_name")
     queue = Queue.queue_with_name(queue_name)
     if not queue:
         self.response.out.write("\"%s\" is not in queues %s" % (queue_name, Queue.all()))
         return None
     return queue
開發者ID:AndriyKalashnykov,項目名稱:webkit,代碼行數:9,代碼來源:updateworkitems.py

示例2: get

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def get(self, queue_name):
        queue_name = queue_name.lower()
        if not Queue.queue_with_name(queue_name):
            self.error(404)
            return

        timestamp = self._get_timestamp()
        view_range = self._get_view_range()
        time_unit, time_unit_name = charts.get_time_unit(view_range)

        all_queue_names = map(Queue.name, Queue.all())

        template_values = {
            "all_queue_names": all_queue_names,
            "patch_data": self._get_patch_data(queue_name, timestamp, view_range),
            "queue_data": self._get_queue_data(queue_name, timestamp, view_range),
            "queue_name": queue_name,
            "seconds_ago_min": 0,
            "seconds_ago_max": view_range,
            "time_unit_name": time_unit_name,
            "time_unit": time_unit,
            "timestamp": timestamp,
            "view_range": view_range,
            "view_range_choices": charts.view_range_choices,
        }
        self.response.out.write(template.render("templates/queuecharts.html", template_values))
開發者ID:venkatarajasekhar,項目名稱:Qt,代碼行數:28,代碼來源:queuecharts.py

示例3: _work_items_from_request

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def _work_items_from_request(self):
        queue_name = self.request.get("queue_name")
        queue = Queue.queue_with_name(queue_name)
        if not queue:
            self.response.out.write("\"%s\" is not in queues %s" % (queue_name, Queue.all()))
            return None

        items_string = self.request.get("work_items")
        work_items = queue.work_items()
        work_items.item_ids = self._parse_work_items_string(items_string)
        work_items.date = datetime.now()
        return work_items
開發者ID:achellies,項目名稱:WinCEWebKit,代碼行數:14,代碼來源:updateworkitems.py

示例4: _build_bubbles_for_attachment

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def _build_bubbles_for_attachment(self, attachment):
        show_submit_to_ews = True
        bubbles = []
        for queue in Queue.all():
            if not self._have_status_for(attachment, queue):
                continue
            bubbles.append(self._build_bubble(queue, attachment))
            # If even one ews has status, we don't show the submit-to-ews button.
            if queue.is_ews():
                show_submit_to_ews = False

        return (bubbles, show_submit_to_ews)
開發者ID:KDE,項目名稱:android-qtwebkit,代碼行數:14,代碼來源:statusbubble.py

示例5: _build_bubbles_for_attachment

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def _build_bubbles_for_attachment(self, attachment):
        show_submit_to_ews = True
        bubbles = []
        for queue in Queue.all():
            if not self._have_status_for(attachment, queue):
                continue
            queue_position = attachment.position_in_queue(queue)
            if queue_position and queue_position >= 100:
                # This queue is so far behind it's not even worth showing.
                continue
            bubbles.append(self._build_bubble(queue, attachment, queue_position))
            # If even one ews has status, we don't show the submit-to-ews button.
            if queue.is_ews():
                show_submit_to_ews = False

        return (bubbles, show_submit_to_ews)
開發者ID:3163504123,項目名稱:phantomjs,代碼行數:18,代碼來源:statusbubble.py

示例6: _build_bubbles_for_attachment

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def _build_bubbles_for_attachment(self, attachment):
        show_submit_to_ews = True
        bubbles = []
        for queue in Queue.all():
            if not self._should_show_bubble_for(attachment, queue):
                continue
            queue_position = attachment.position_in_queue(queue)
            bubble = self._build_bubble(queue, attachment, queue_position)
            if bubble:
                bubbles.append(bubble)
            # If at least one EWS queue has status, we don't show the submit-to-ews button.
            if queue.is_ews():
                show_submit_to_ews = False

        failed_to_apply = any(map(lambda bubble: "failed_to_apply" in bubble, bubbles))
        had_resultative_status_other_than_failure_to_apply = any(map(lambda bubble: bubble["had_resultative_status_other_than_failure_to_apply"], bubbles))

        return (bubbles, show_submit_to_ews, failed_to_apply and not had_resultative_status_other_than_failure_to_apply)
開發者ID:eocanha,項目名稱:webkit,代碼行數:20,代碼來源:statusbubble.py

示例7: _fetch_summary

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
    def _fetch_summary(self):
        summary = { "attachment_id" : self.id }

        first_status = QueueStatus.all().filter('active_patch_id =', self.id).get()
        if not first_status:
            # We don't have any record of this attachment.
            return summary
        summary["bug_id"] = first_status.active_bug_id

        for queue in Queue.all():
            summary[queue.name_with_underscores()] = None
            status = QueueStatus.all().filter('queue_name =', queue.name()).filter('active_patch_id =', self.id).order('-date').get()
            if status:
                # summary() is a horrible API and should be killed.
                summary[queue.name_with_underscores()] = {
                    "state": self.state_from_queue_status(status),
                    "status": status,
                }
        return summary
開發者ID:Happy-Ferret,項目名稱:webkit.js,代碼行數:21,代碼來源:attachment.py

示例8: _calculate_queue_positions

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
 def _calculate_queue_positions(self):
     all_work_items = WorkItems.all().fetch(limit=len(Queue.all()))
     return dict([(items.queue.name(), items.display_position_for_attachment(self.id)) for items in all_work_items if items.queue])
開發者ID:Happy-Ferret,項目名稱:webkit.js,代碼行數:5,代碼來源:attachment.py

示例9: get

# 需要導入模塊: from model.queues import Queue [as 別名]
# 或者: from model.queues.Queue import all [as 別名]
 def get(self):
     template_values = {"queues": [QueueBubble(queue) for queue in Queue.all()]}
     self.response.out.write(template.render("templates/recentstatus.html", template_values))
開發者ID:venkatarajasekhar,項目名稱:Qt,代碼行數:5,代碼來源:recentstatus.py


注:本文中的model.queues.Queue.all方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。