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

Function main

docs/website/scripts/generate_cn1libs.py:194–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193
194def main() -> int:
195 try:
196 xml_text = fetch_xml(SOURCE_URL)
197 libs = parse_xml(xml_text)
198 write_data(libs, status="ok")
199 print(f"Generated {OUT_PATH} with {len(libs)} cn1libs entries")
200 return 0
201 except (URLError, HTTPError, TimeoutError, ET.ParseError) as err:
202 if OUT_PATH.exists():
203 print(f"Warning: failed to refresh cn1libs ({err}); keeping existing data at {OUT_PATH}", file=sys.stderr)
204 return 0
205
206 write_data([], status="error", error=str(err))
207 print(f"Warning: failed to refresh cn1libs ({err}); wrote empty fallback data", file=sys.stderr)
208 return 0
209
210
211if __name__ == "__main__":

Callers 1

Calls 4

fetch_xmlFunction · 0.85
parse_xmlFunction · 0.85
write_dataFunction · 0.85
existsMethod · 0.65

Tested by

no test coverage detected