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

Function _parse_hhmm

deployments/feishu/webhook-server/scripts/scheduler.py:75–84  ·  view source on GitHub ↗
(value: str, default: str)

Source from the content-addressed store, hash-verified

73
74def _parse_hhmm(value: str, default: str) -> tuple[int, int]:
75 raw = (value or default).strip()
76 try:
77 hour_str, minute_str = raw.split(":", 1)
78 hour = max(0, min(23, int(hour_str)))
79 minute = max(0, min(59, int(minute_str)))
80 return hour, minute
81 except Exception:
82 fallback_hour, fallback_minute = default.split(":", 1)
83 return int(fallback_hour), int(fallback_minute)
84
85
86def get_daily_push_time() -> tuple[int, int]:
87 return _parse_hhmm(os.environ.get("PAPERFLOW_DAILY_PUSH_TIME", "09:00"), "09:00")

Callers 2

get_daily_push_timeFunction · 0.85
get_weekly_report_timeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected