MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _env_positive_int

Function _env_positive_int

deployments/feishu/daily-push-agent/main.py:108–113  ·  view source on GitHub ↗
(name: str, default: int = 5, cap: int = 10)

Source from the content-addressed store, hash-verified

106def _env_positive_int(name: str, default: int = 5, cap: int = 10) -> int:
107 try:
108 value = int(float(os.environ.get(name, default)))
109 except (TypeError, ValueError):
110 value = default
111 return max(1, min(cap, value))
112
113
114def _strip_html(text: Any) -> str:
115 return re.sub(r"<[^>]+>", " ", str(text or "")).replace("&nbsp;", " ").strip()
116

Callers 2

fetch_custom_rss_papersFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected