1. Python / Говнокод #25676

    −1

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    def _run(self):
        L.debug('CommentsMonitor started.')
        with requests.Session() as sess:
            bormand = Bormand(sess)
            while True:
                comments = bormand.get_comments()
                if comments is not None:
                    for comment_json in comments:
                        comment = Comment(comment_json)
                        if comment.id not in self.replied_cache and comment.user_id not in self.users_blacklist:
                            task = parse_comment(comment)
                            if task is not None:
                                L.debug('Replying to: ' + str(comment))
                                self.replied_cache.add(comment.id)
                                self.tasks_queue.put(task)
                else:  # comments is None
                    L.warning('Failed to load comments')
                if self._stop_ev.wait(timeout=self.pause_time):
                    break
        L.debug('CommentsMonitor stopped.')

    Какой уровень вложенности )))

    Запостил: gost, 17 Июня 2019

    Комментарии (170) RSS

    Добавить комментарий