Delete rejected articles, if there is an articles param, purge from there, otherwise purge from source instance. Reference this StackOverflow post for some of the wonky syntax below: http://stackoverflow.com/questions/1207406/remove-items-from-a- list-while-i
(self, reason, articles)
| 103 | self.generate_articles() |
| 104 | |
| 105 | def purge_articles(self, reason, articles): |
| 106 | """Delete rejected articles, if there is an articles param, |
| 107 | purge from there, otherwise purge from source instance. |
| 108 | |
| 109 | Reference this StackOverflow post for some of the wonky |
| 110 | syntax below: |
| 111 | http://stackoverflow.com/questions/1207406/remove-items-from-a- |
| 112 | list-while-iterating-in-python |
| 113 | """ |
| 114 | if reason == 'url': |
| 115 | articles[:] = [a for a in articles if a.is_valid_url()] |
| 116 | elif reason == 'body': |
| 117 | articles[:] = [a for a in articles if a.is_valid_body()] |
| 118 | return articles |
| 119 | |
| 120 | @utils.cache_disk(seconds=(86400*1), cache_folder=ANCHOR_DIRECTORY) |
| 121 | def _get_category_urls(self, domain): |
no test coverage detected