Skip to content

Commit 5c5a061

Browse files
committed
py-apidoc from pydoctor
After years of epydoc discontinuation use pydoctor as a quick replacement. Generate and publish what's left from the python API. Signed-off-by: Sascha Lucas <[email protected]>
1 parent 5e07f52 commit 5c5a061

File tree

834 files changed

+1149777
-38
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

834 files changed

+1149777
-38
lines changed

docs/ganeti/3.0/api/py/ajax.js

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Implement simple cached AJAX functions.
2+
3+
var _cache = {};
4+
5+
/*
6+
* Get a promise for the HTTP get responseText.
7+
*/
8+
function httpGetPromise(url) {
9+
const promise = new Promise((_resolve, _reject) => {
10+
httpGet(url, (responseText) => {
11+
_resolve(responseText);
12+
},
13+
(error) => {
14+
_reject(error);
15+
});
16+
});
17+
return promise
18+
}
19+
20+
function httpGet(url, onload, onerror) {
21+
if (_cache[url]) {
22+
_cachedHttpGet(url, onload, onerror);
23+
}
24+
else{
25+
_httpGet(url, onload, onerror);
26+
}
27+
}
28+
29+
function _cachedHttpGet(url, onload, onerror) {
30+
setTimeout(() => { onload(_cache[url]) }, 0);
31+
}
32+
33+
function _httpGet(url, onload, onerror) {
34+
35+
var xobj = new XMLHttpRequest();
36+
xobj.open('GET', url, true); // Asynchronous
37+
38+
xobj.onload = function () {
39+
// add document to cache.
40+
_cache[url] = xobj.responseText;
41+
onload(xobj.responseText);
42+
};
43+
44+
xobj.onerror = function (error) {
45+
console.log(error)
46+
onerror(error)
47+
};
48+
49+
xobj.send(null);
50+
}

0 commit comments

Comments
 (0)