MCPcopy Create free account
hub / github.com/ElementsProject/lightning / github_plugins_repo_api

Function github_plugins_repo_api

tests/rkls_github_canned_server.py:11–21  ·  view source on GitHub ↗

This emulates api.github.com calls to lightningd/plugins

(github_user, github_repo)

Source from the content-addressed store, hash-verified

9
10 @app.route("/api/repos/<github_user>/<github_repo>/contents/")
11 def github_plugins_repo_api(github_user, github_repo):
12 '''This emulates api.github.com calls to lightningd/plugins'''
13 user = escape(github_user)
14 repo = escape(github_repo)
15 canned_api = os.environ.get('REDIR_GITHUB') + f'/rkls_api_{user}_{repo}.json'
16 with open(canned_api, 'rb') as f:
17 canned_data = f.read(-1)
18 print(f'serving canned api data from {canned_api}')
19 resp = flask.Response(response=canned_data,
20 headers={'Content-Type': 'application/json; charset=utf-8'})
21 return resp
22
23 @app.route("/api/repos/<github_user>/<github_repo>/git/trees/<plugin_name>")
24 def github_plugin_tree_api(github_user, github_repo, plugin_name):

Callers

nothing calls this directly

Calls 3

escapeFunction · 0.85
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected