MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _task_is_allowed

Function _task_is_allowed

scripts/website/queue_browser_syndication.py:70–83  ·  view source on GitHub ↗

Whether an existing queue task is still permitted under the per-platform rules. Used to prune tasks that were queued before the Friday-only filter existed (or added by hand): the drain tool submits whatever is in the queue, so a disallowed task left here would still reach moderation. A t

(task: dict, dates_by_slug: dict[str, dt.date])

Source from the content-addressed store, hash-verified

68
69
70def _task_is_allowed(task: dict, dates_by_slug: dict[str, dt.date]) -> bool:
71 """Whether an existing queue task is still permitted under the per-platform
72 rules. Used to prune tasks that were queued before the Friday-only filter
73 existed (or added by hand): the drain tool submits whatever is in the
74 queue, so a disallowed task left here would still reach moderation. A task
75 whose post date is unknown is kept — we never silently drop something we
76 cannot evaluate."""
77 platform = task.get("site")
78 if platform not in WEEKLY_FRIDAY_PLATFORMS:
79 return True
80 post_date = dates_by_slug.get(task.get("slug"))
81 if post_date is None:
82 return True
83 return post_date.weekday() == 4
84
85
86def _markdown_to_html(text: str) -> str:

Callers 1

mainFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected