def out_of_content(self, card_count):
"""
Count the number of cards that are part of our page counting. If we've
already displayed this number of cards, we are out of content.
"""
card_limit = 0
for application in self.config.get("applications", "enabled").replace(" ", "").split(","):
app_state = getattr(self, application)
for ctype in app_state.config.get("card_properties", "pagecount").replace(" ", "").split(","):
if ctype in app_state.config.get("card_properties", "randomize"):
card_limit += self.page * app_state.config.getint("card_counts", ctype)
else:
card_limit = card_limit + getattr(app_state, ctype).file_count
syslog.syslog("card_limit: " + str(card_limit) + " card_count: " + str(card_count))
if card_count >= card_limit:
return True
else:
return False
评论列表
文章目录