Commit c9903b2a authored by Oliver Behnke's avatar Oliver Behnke

Merge branch 'master' into drupal-eah-einstein

parents 6a449bd0 6b9c977a
...@@ -60,6 +60,7 @@ command -v jq >/dev/null 2>&1 || { echo >&2 "jq (command-line json parser) is ne ...@@ -60,6 +60,7 @@ command -v jq >/dev/null 2>&1 || { echo >&2 "jq (command-line json parser) is ne
if [ "${BINTRAY_API_KEY}" == "" ] ; then if [ "${BINTRAY_API_KEY}" == "" ] ; then
echo "BINTRAY_API_KEY is missing; doing nothing" echo "BINTRAY_API_KEY is missing; doing nothing"
exit 0 exit 0
fi
BINTRAY_API=https://api.bintray.com BINTRAY_API=https://api.bintray.com
BINTRAY_USER="${BINTRAY_USER:-ChristianBeer}" BINTRAY_USER="${BINTRAY_USER:-ChristianBeer}"
...@@ -102,7 +103,7 @@ ${BINTRAY_CURL} "${BINTRAY_API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$ ...@@ -102,7 +103,7 @@ ${BINTRAY_CURL} "${BINTRAY_API}/packages/${BINTRAY_REPO_OWNER}/${BINTRAY_REPO}/$
pr_ids=$(jq -r .versions[]? < "${TMPDIR}/package_pr.txt" | cut -d_ -f1 | cut -b 3- | sort -u) pr_ids=$(jq -r .versions[]? < "${TMPDIR}/package_pr.txt" | cut -d_ -f1 | cut -b 3- | sort -u)
for pr in $pr_ids for pr in $pr_ids
do do
echo $pr echo "$pr"
state=$(${GITHUB_CURL} "${GITHUB_API}/repos/${GITHUB_USER}/${GITHUB_REPO}/pulls/${pr}" | jq -r .state) state=$(${GITHUB_CURL} "${GITHUB_API}/repos/${GITHUB_USER}/${GITHUB_REPO}/pulls/${pr}" | jq -r .state)
if [ "$state" = "closed" ]; then if [ "$state" = "closed" ]; then
echo " is closed" echo " is closed"
......
...@@ -1309,6 +1309,8 @@ function boincuser_form_alter(&$form, $form_state, $form_id) { ...@@ -1309,6 +1309,8 @@ function boincuser_form_alter(&$form, $form_state, $form_id) {
$form['register_captcha'] = array( $form['register_captcha'] = array(
'#type' => 'captcha', '#type' => 'captcha',
'#weight' => 1000, '#weight' => 1000,
'#prefix' => '<div id="captcha-on-left">',
'#suffix' => '</div>'
); );
} }
......
...@@ -644,6 +644,10 @@ html.js fieldset.collapsible legend a, ...@@ -644,6 +644,10 @@ html.js fieldset.collapsible legend a,
#recaptcha_response_field { #recaptcha_response_field {
left: 0; left: 0;
} }
/* This id cancels out the above margin-left for .captcha*/
#captcha-on-left {
margin-left: -360px;
}
/* Task App filter */ /* Task App filter */
select.task-app-filter { select.task-app-filter {
...@@ -661,4 +665,4 @@ select.task-app-filter { ...@@ -661,4 +665,4 @@ select.task-app-filter {
font-weight: 400; font-weight: 400;
line-height: 24px; line-height: 24px;
margin-right: 40px; margin-right: 40px;
} }
\ No newline at end of file
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
// boinc_query_job(): get details of a job // boinc_query_job(): get details of a job
// boinc_retire_batch(): retire a batch; delete output files // boinc_retire_batch(): retire a batch; delete output files
// boinc_submit_batch(): submit a batch // boinc_submit_batch(): submit a batch
//
// boinc_set_timeout($x): set RPC timeout to X seconds
//// Implementation stuff follows //// Implementation stuff follows
...@@ -119,10 +121,17 @@ function validate_request($req) { ...@@ -119,10 +121,17 @@ function validate_request($req) {
return null; return null;
} }
$rpc_timeout = 0;
function do_http_op($req, $xml, $op) { function do_http_op($req, $xml, $op) {
global $rpc_timeout;
$ch = curl_init("$req->project/submit_rpc_handler.php"); $ch = curl_init("$req->project/submit_rpc_handler.php");
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($rpc_timeout) {
curl_setopt($ch, CURLOPT_TIMEOUT, $rpc_timeout);
}
// see if we need to send any files // see if we need to send any files
// //
...@@ -198,6 +207,12 @@ function get_error($reply, $outer_tag) { ...@@ -198,6 +207,12 @@ function get_error($reply, $outer_tag) {
} }
//// API functions follow //// API functions follow
function boinc_set_timeout($x) {
global $rpc_timeout;
$rpc_timeout = $x;
}
function boinc_ping($req) { function boinc_ping($req) {
$req_xml = "<ping> $req_xml = "<ping>
<authenticator>$req->authenticator</authenticator> <authenticator>$req->authenticator</authenticator>
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
# Python bindings of the remote job submission and file management APIs # Python bindings of the remote job submission and file management APIs
import urllib import urllib
import urllib2
import copy import copy
import xml.etree.ElementTree as ET import xml.etree.ElementTree as ET
import requests import requests
...@@ -111,17 +112,26 @@ class REQUEST: ...@@ -111,17 +112,26 @@ class REQUEST:
def __init__(self): def __init__(self):
return return
rpc_timeout = 0
def do_http_post(req, project_url, handler='submit_rpc_handler.php'): def do_http_post(req, project_url, handler='submit_rpc_handler.php'):
#print req #print req
url = project_url + handler url = project_url + handler
params = urllib.urlencode({'request': req}) params = urllib.urlencode({'request': req})
f = urllib.urlopen(url, params) if rpc_timeout>0:
f = urllib2.urlopen(url, params, rpc_timeout)
else:
f = urllib2.urlopen(url, params)
reply = f.read() reply = f.read()
#print "REPLY:", reply #print "REPLY:", reply
return ET.fromstring(reply) return ET.fromstring(reply)
########### API FUNCTIONS START HERE ############### ########### API FUNCTIONS START HERE ###############
def set_timeout(x):
global rpc_timeout
rpc_timeout = x
def abort_batch(req): def abort_batch(req):
req_xml = ('<abort_batch>\n' req_xml = ('<abort_batch>\n'
'<authenticator>%s</authenticator>\n' '<authenticator>%s</authenticator>\n'
......
...@@ -198,4 +198,5 @@ def test_get_job_counts(): ...@@ -198,4 +198,5 @@ def test_get_job_counts():
#test_query_batch(328) #test_query_batch(328)
#test_submit_batch('batch_39') #test_submit_batch('batch_39')
#test_create_batch('batch_33') set_timeout(10)
test_create_batch('batch_138')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment