MCPcopy Create free account
hub / github.com/FastLED/FastLED / from_env

Method from_env

ci/github_project_sync.py:53–76  ·  view source on GitHub ↗

Parse configuration from environment variables.

(cls: type[Config])

Source from the content-addressed store, hash-verified

51
52 @classmethod
53 def from_env(cls: type[Config]) -> Config:
54 """Parse configuration from environment variables."""
55 project_number_raw = os.environ.get("PROJECT_NUMBER", "")
56 if not project_number_raw:
57 raise SystemExit("PROJECT_NUMBER is required")
58
59 item_node_id = os.environ.get("ITEM_NODE_ID", "")
60 if not item_node_id:
61 raise SystemExit("ITEM_NODE_ID is required (no issue or PR node ID)")
62
63 return cls(
64 project_owner=os.environ.get("PROJECT_OWNER", ""),
65 project_owner_type=os.environ.get("PROJECT_OWNER_TYPE", "organization"),
66 project_number=int(project_number_raw),
67 status_field=os.environ.get("STATUS_FIELD", "Status"),
68 status_todo=os.environ.get("STATUS_TODO", "Todo"),
69 status_done=os.environ.get("STATUS_DONE", "Done"),
70 status_draft=os.environ.get("STATUS_DRAFT", ""),
71 date_field=os.environ.get("DATE_FIELD", ""),
72 event_name=os.environ.get("EVENT_NAME", ""),
73 event_action=os.environ.get("EVENT_ACTION", ""),
74 item_node_id=item_node_id,
75 is_draft=os.environ.get("IS_DRAFT", "false").lower() == "true",
76 )
77
78
79def graphql(query: str, variables: dict[str, Any]) -> dict[str, Any]:

Callers 7

mainFunction · 0.80
test_is_draft_trueMethod · 0.80
test_empty_date_fieldMethod · 0.80

Calls 1

getMethod · 0.45