projects
/
gitlive
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed NewBranch.bjsNewBranch.valaRooTicket.valaTicket.bjsTicket.vala
[gitlive]
/
tests
/
tickets.js
diff --git
a/tests/tickets.js
b/tests/tickets.js
index
a459564
..
5577311
100644
(file)
--- a/
tests/tickets.js
+++ b/
tests/tickets.js
@@
-3,8
+3,14
@@
* let's see if we can pull a list of tickets from the tracker..
*
*/
* let's see if we can pull a list of tickets from the tracker..
*
*/
+
+GI = imports.gi.GIRepository
GLib = imports.gi.GLib;
GLib = imports.gi.GLib;
+// we add this in, as it appears to get lost sometimes if we set it using the ENV. variable in builder.sh
+GI.IRepository.prepend_search_path(GLib.get_home_dir() + '/.Builder/girepository-1.1');
+
+Soup = imports.gi.Soup ;
File = imports['../File.js'].File;
File = imports['../File.js'].File;
@@
-29,19
+35,28
@@
Tickets = {
},
},
- fetchBugs : function()
+ fetchBugs : function(
url
)
{
{
+ Tickets.parseNetrc();
+ var ar = url.split('/');
+ print(JSON.stringify(ar, null, 4));
+ var auth = new Soup.Auth()
var session = new Soup.SessionSync();
var session = new Soup.SessionSync();
-
- var status = session.send_message(
- new Soup.Message({
+ session.signal.authenticate.connect(function(sess, msg, auth, rt) {
+ //print("authenticate?");
+ auth.authenticate(
+ Tickets.machines[ar[2]].login,
+ Tickets.machines[ar[2]].password
+ );
+ });
+ var request = new Soup.Message({
method:"GET",
method:"GET",
- uri:new Soup.URI.c_new(
"http://roojs.com/mtrack.php/Bugs"
)
- })
- );
+ uri:new Soup.URI.c_new(
url
)
+ })
;
+ var status = session.send_message(request);
var data = request.response_body.data;
var data = request.response_body.data;
-
print(data)
;
+
return JSON.parse(data).data
;
}
}
@@
-49,7
+64,11
@@
Tickets = {
}
}
-Tickets.parseNetrc();
+
//print ( JSON.stringify(Tickets.machines) );
//print ( JSON.stringify(Tickets.machines) );
-Tickets.fetchBugs();
+
+
+
+//Tickets.fetchBugs("http://www.roojs.com/mtrack/index.php/Gitlive/web.hex");
+
\ No newline at end of file