2014-05-15T07:55:21 *** zoso has joined #servelots 2014-05-15T12:59:14 *** ecthiender has joined #servelots 2014-05-15T13:46:12 ecthiender, ping 2014-05-15T13:47:33 zoso, pong 2014-05-15T13:48:51 ecthiender, documentation misses steps to be done after updating submodule 2014-05-15T13:48:59 :P 2014-05-15T13:49:22 documentation misses about submodule as well. :P what are the steps after updating submodule? 2014-05-15T13:49:30 zoso, 2014-05-15T13:49:51 ecthiender, copying sample_config to config and editing the config gile 2014-05-15T13:49:59 no. thats there. 2014-05-15T13:50:12 under the heading configure swtstore? 2014-05-15T13:50:31 zoso, you are reading the README file right? 2014-05-15T13:51:01 Inside um there is a sample_config, I am talking about that dude, of course I am reading the README 2014-05-15T13:51:19 * zoso thinks gitorious should have a markdown viewer 2014-05-15T13:51:31 oh okay. xD 2014-05-15T13:51:38 the um module doesn't have any docs yet. 2014-05-15T13:51:47 please give it some love :) 2014-05-15T13:51:47 ecthiender, yes, I will add that 2014-05-15T13:52:42 zoso, also I couldn't think of a better and short name for the User Management module :P 2014-05-15T13:53:17 and what is this yourapp in the conf.py under um, why is it throwing an exception of ModuleError. 2014-05-15T13:53:42 :) ya got it, initially I was like, is that a typo :P 2014-05-15T13:53:53 you have to replace that with your app :) 2014-05-15T13:53:54 from swtstore.classes.database import db 2014-05-15T13:53:58 ^ that was with ref to um thing 2014-05-15T13:54:27 its a sample config file. So some sample line. 2014-05-15T13:54:28 :O 2014-05-15T13:54:57 I understood that, I think I can add some love to the docs there 2014-05-15T13:55:21 Just a bit cryptic the lines in config.py 2014-05-15T13:55:25 okay so you have from swtstore.classes.database import db in your um/config.py 2014-05-15T13:55:28 ? 2014-05-15T13:55:39 okay so you have "from swtstore.classes.database import db" in your um/config.py? 2014-05-15T13:55:59 yes 2014-05-15T13:56:51 and you have updated the config file in your main swtstore application? 2014-05-15T13:56:55 zoso, 2014-05-15T13:57:04 yup 2014-05-15T13:57:20 cool. now you are good to go. :) run the dbsetup.py script. 2014-05-15T13:58:06 success? 2014-05-15T13:58:52 ecthiender, yes :) 2014-05-15T13:59:05 python runserver.py? running? 2014-05-15T13:59:11 zoso, 2014-05-15T13:59:20 yes 2014-05-15T13:59:28 cool 2014-05-15T13:59:45 looks good :) 2014-05-15T13:59:45 now log in with persona and register an app. 2014-05-15T13:59:59 and when it asks for URL about the app and all, you have to give the URL where you would run the swtr app 2014-05-15T13:59:59 zoso, ^ 2014-05-15T14:00:00 also have to register an img-anno context. :) 2014-05-15T14:00:06 ecthiender, I see 2014-05-15T14:00:36 zoso, you can also write your own application to sweet to sweet store :) 2014-05-15T14:00:55 ecthiender, what should be the redirect uri ? 2014-05-15T14:01:40 the URL to which it would redirect to - mostly the host url of the third-party app. 2014-05-15T14:02:19 so in my case both are http://localhost:5000 2014-05-15T14:02:22 zoso, ^ 2014-05-15T14:02:36 Ok :) 2014-05-15T14:03:33 ecthiender, do you have a reference json-ld 2014-05-15T14:04:04 umm. no. its just a dummy now. do not use it internally to do anything. its just stored in the db. 2014-05-15T14:04:24 zoso, just put a any JSON. {"sample": "doesnt work"} 2014-05-15T14:04:31 :P 2014-05-15T14:04:33 Aah ok :) 2014-05-15T14:04:51 btw, a bit tangential to this context, check this out lakhin.com/projects/papa-carlo/demo/ 2014-05-15T14:05:05 incremental JSON parser 2014-05-15T14:06:15 * ecthiender is checking 2014-05-15T14:06:30 * zoso has successfully registered a context and app 2014-05-15T14:07:39 zoso, looks cool 2014-05-15T14:07:58 zoso, you can also update your user profile in the swtstore :P 2014-05-15T14:08:09 by default there is no username. update that. 2014-05-15T14:09:19 ecthiender, done. account created seems to be buggy, does not show created date, rather shows "invalid date" 2014-05-15T14:09:48 zoso, I know. its not buggy. its not implemented yet. 2014-05-15T14:09:52 ohh ok 2014-05-15T14:09:52 zoso, the javascript side of handling dates. Its a kinda work. :/ 2014-05-15T14:10:03 Ya, I see the timestamp for a sec and then it goes off 2014-05-15T14:10:06 zoso, so I decided to use moment.js http://momentjs.com/ 2014-05-15T14:10:09 Title: Moment.js | Parse, validate, manipulate, and display dates in javascript. (at momentjs.com) 2014-05-15T14:10:51 yeah I append it to the template, then I do new Date() in JS, which renders it invalid :| 2014-05-15T14:11:05 hehe :P 2014-05-15T14:11:12 firstworldproblems 2014-05-15T14:11:29 :P 2014-05-15T14:11:56 btw, how do I authorize an app, I have registered an app 2014-05-15T14:12:36 zoso, so now anybody can use that app, to do actions on the swtstore. 2014-05-15T14:12:56 aah ok 2014-05-15T14:13:23 and when someone uses the app for the first time, they need to authorize the access of this app. zoso 2014-05-15T14:14:54 I see. I will pull swtr code from persona branch 2014-05-15T14:15:00 zoso, its like how when you use a facebook app for the first time you need to give it access, and then it can post status etc. on your behalf. 2014-05-15T14:15:16 zoso, yeah. 2014-05-15T14:15:19 yup gotcha :) 2014-05-15T14:15:37 zoso, setting up the swtr is also not documented :P 2014-05-15T14:15:53 zoso, I'll help ya with it. 2014-05-15T14:16:24 basically you need to set the app id and app secret with the swtr instance you will be running. 2014-05-15T14:16:30 :D maybe we just gather the commits from git log and kind of make that the docs 2014-05-15T14:17:02 zoso, yeah. even the source code. 2014-05-15T14:17:10 we should really use doc generator 2014-05-15T14:18:12 ya, so that you know writing good commit messages becomes a rule, not a thing to keep in hindsight, and it is not really tough to explain what you have done really in few lines. 2014-05-15T14:19:31 zoso, yeah. I agree. absolutely. along with it we should also have a doc generator to get docs from source code. the comments act as in line docs as well something available concisely on the web 2014-05-15T14:19:52 and also annotated source code to feed the doc generator 2014-05-15T14:19:58 agree with you :) 2014-05-15T14:20:47 yeah 2014-05-15T14:21:52 * zoso is just amazed at the sheer number of words in swtr.explain 2014-05-15T14:23:48 zoso, lol :D its not complete 2014-05-15T14:24:40 we should complete that. 2014-05-15T14:24:53 and that becomes our architecture docuement. :P 2014-05-15T14:26:06 I was trying to write that sometime back. 2014-05-15T14:26:13 anyway, got the persona branch? 2014-05-15T14:27:06 looks good enough, will try to add to it. 2014-05-15T14:27:11 yes got the branch 2014-05-15T14:28:45 cool. so in the server.py you have to replace the appID and appSecret with the ones you got from your swtstore. 2014-05-15T14:29:38 and you have to the same in the swtmaker.js at line 235. zoso 2014-05-15T14:31:19 umm, we have code in the repo with these values, merge conflicts when working with each other. yay :P 2014-05-15T14:31:45 zoso, I know. :P 2014-05-15T14:31:55 didn't get the time to clean it up. 2014-05-15T14:32:17 was doing it more like an experiment. that's why I mention that in the commit :P 2014-05-15T14:34:17 ecthiender, just kidding. I am running server.py with the values set, let's test some annos 2014-05-15T14:34:23 zoso, so now load the app and hit sign in.. 2014-05-15T14:34:49 InvalidScopeError :( 2014-05-15T14:35:19 zoso, :P what scopes have you mentioned in the swt store, when registering the app? 2014-05-15T14:35:27 shit forgot to tell you about scopes 2014-05-15T14:35:32 only email 2014-05-15T14:35:39 I thought that works 2014-05-15T14:35:42 :$ 2014-05-15T14:35:50 oh. no. you have to mention sweets as well. 2014-05-15T14:35:57 *sweet rather 2014-05-15T14:36:00 aah 2014-05-15T14:36:08 cause the app will be doing the action "sweet" 2014-05-15T14:36:26 anyway, there's no edit interface yet for you to change the scopes :P 2014-05-15T14:36:32 hehehe :) 2014-05-15T14:36:32 Ya got that one 2014-05-15T14:36:36 and the delete ain't working too 2014-05-15T14:36:36 yeah 2014-05-15T14:36:36 but good job 2014-05-15T14:36:36 so can you update the database directly :) :P 2014-05-15T14:36:43 for the sweet store in general, or the oauth in specific? :P 2014-05-15T14:36:48 zoso, so: update clients set _default_scopes="email sweet context" 2014-05-15T14:36:48 ; 2014-05-15T14:36:48 ecthiender, for sweet store in general :) 2014-05-15T14:36:48 ecthiender, that is inside psql terminal? 2014-05-15T14:36:48 yeah 2014-05-15T14:36:48 selecting the database 2014-05-15T14:36:48 thanks :) 2014-05-15T14:36:48 zoso, hey btw, the error that you got, was it a json error, or was it a whole stack trace? 2014-05-15T14:36:48 s/json/jsonified/ 2014-05-15T14:36:48 ecthiender, which one? 2014-05-15T14:36:48 the InvalidScopeError 2014-05-15T14:36:48 ecthiender, that was a python stack trace 2014-05-15T14:36:48 hmm 2014-05-15T14:36:48 should handle that..and send back a error response 2014-05-15T14:36:48 zoso, updated? 2014-05-15T14:36:48 Hmmm, and dude update clients fails 2014-05-15T14:36:48 hmm. why? 2014-05-15T14:36:48 I get an error saying "email sweet context" does not exist 2014-05-15T14:36:48 is the syntax fine? 2014-05-15T14:36:48 zoso, use single quotes 2014-05-15T14:36:48 ? 2014-05-15T14:36:48 done 2014-05-15T14:36:48 and try 2014-05-15T14:36:48 works? 2014-05-15T14:36:48 ya works with '' 2014-05-15T14:36:48 oh ok. what was the problem? 2014-05-15T14:36:48 "" was the problem 2014-05-15T14:36:48 ? 2014-05-15T14:36:48 psql thinks "value" is column 2014-05-15T14:36:48 the double quotes? 2014-05-15T14:36:48 not a string literal 2014-05-15T14:36:48 yeah. so works with single quotes no? 2014-05-15T14:36:48 yeah. I remembered. 2014-05-15T14:36:48 yes works with '' 2014-05-15T14:36:48 cool. 2014-05-15T14:36:48 from here, the single quote closing and opening looks like one double quote :P 2014-05-15T14:36:48 so I was confused at first 2014-05-15T14:36:48 ecthiender, aah :P 2014-05-15T14:36:48 zoso, :) okay. try now. 2014-05-15T14:36:48 cool, so the sign in works too :d 2014-05-15T14:36:48 ecthiender, but FF complains of a CORS request 2014-05-15T14:36:53 zoso, shit for me its now working :/ 2014-05-15T14:36:59 I keep getting logged out! 2014-05-15T14:37:08 zoso, you are signed in? 2014-05-15T14:37:12 s/now/not/ 2014-05-15T14:37:12 ecthiender, just says signing you in 2014-05-15T14:37:12 zoso, uh oh. it fails on an error. 2014-05-15T14:37:12 I mean it has failed. 2014-05-15T14:37:25 whats the CORS error? 2014-05-15T14:38:00 zoso, ^ 2014-05-15T14:38:01 ecthiender, seems to be a 500 on sweet store 2014-05-15T14:38:19 give the CORS error and the 500. 2014-05-15T14:38:22 s/give/tell me/ 2014-05-15T14:38:43 okay. I figured my error. It was a proxy issue. the proxy here is down. 2014-05-15T14:39:13 ecthiender, on the python console for sweet store I see TypeError:getCurrentUser takes 1 argument 0 given 2014-05-15T14:40:21 zoso, can you tell me which function is calling that? 2014-05-15T14:43:00 ecthiender, it is being called when flask is sending a response to the request for /api/users/me, stack trace tell more 2014-05-15T14:45:26 zoso, can you paste the stack trace somewhere? 2014-05-15T14:46:37 ecthiender, yes 2014-05-15T14:46:43 gimme a minute 2014-05-15T14:46:48 sure 2014-05-15T14:49:41 ecthiender, http://bpaste.net/show/h1aHDNLCrJLGc3rDVOYs/ 2014-05-15T14:49:42 Title: Paste #h1aHDNLCrJLGc3rDVOYs at spacepaste (at bpaste.net) 2014-05-15T14:50:27 ecthiender, heading out for a smoke, will be back in a while 2014-05-15T14:50:35 zoso, okay. 2014-05-15T14:53:58 zoso, getCurrentUser doesn't take any argument: http://git.pantoto.org/user-management/user-management/blobs/master/user.py#line45 . Why does it say it takes 1 argument. Its a static method, so no passing of self! 2014-05-15T14:54:00 Title: user.py - user-management in User Management - Gitorious (at git.pantoto.org) 2014-05-15T14:55:10 zoso, any ideas? 2014-05-15T14:55:40 ecthiender, none, right now, checking out the docs of static method, code looks fine 2014-05-15T14:55:53 check your user management code? 2014-05-15T14:55:59 zoso, ^ 2014-05-15T14:56:20 ecthiender, for? 2014-05-15T14:56:27 ?y chance. look at the getCurrentUser function? 2014-05-15T14:56:39 at the user.py file 2014-05-15T14:56:42 zoso, 2014-05-15T14:58:49 zoso, it looks the same? 2014-05-15T14:58:57 ecthiender, yes, looks the same 2014-05-15T14:59:06 why would it look different anyway 2014-05-15T14:59:10 :P 2014-05-15T14:59:21 i don't know. different git checkouts? 2014-05-15T14:59:44 Hmm, I think we are just using staticmethod wrong maybe 2014-05-15T14:59:52 https://docs.python.org/2/library/functions.html#staticmethod 2014-05-15T14:59:53 Title: 2. Built-in Functions Python v2.7.6 documentation (at docs.python.org) 2014-05-15T14:59:56 umm. works for me. 2014-05-15T15:00:00 * ecthiender is checking 2014-05-15T15:00:03 weird 2014-05-15T15:00:57 zoso, looking at the docs, we are using it exactly how it says. 2014-05-15T15:00:57 A static method does not receive an implicit first argument. 2014-05-15T15:00:57 ecthiender, ok, I will check my config files, if the values of app id and app secret are fine 2014-05-15T15:00:57 zoso, yeah can you go to sweet store and open the page with your registered apps? 2014-05-15T15:00:57 ecthiender, yes 2014-05-15T15:00:57 I can see the app 2014-05-15T15:01:43 what scopes does it show? 2014-05-15T15:01:45 zoso, 2014-05-15T15:01:45 ecthiender, does not show scopes 2014-05-15T15:01:45 zoso, hmm. thats the problem. I guess. 2014-05-15T15:01:45 what does "select * from clients;" show in your psql terminal? 2014-05-15T15:01:45 ecthiender, hey wait, I think I misread your question, registered apps shows context, but authorized app does not. Sorry 2014-05-15T15:01:53 zoso, what does the db say? 2014-05-15T15:02:41 ecthiender, that has the scope set to email sweet context 2014-05-15T15:03:31 but this URL http://localhost:5001/users/me/apps shows only context? 2014-05-15T15:03:52 Not like: "Scopes: email, sweet, context"? 2014-05-15T15:04:04 ecthiender, it shows all 3 2014-05-15T15:04:49 zoso, hmm. then thats fine. 2014-05-15T15:04:50 ecthiender, umm, the host url is without http 2014-05-15T15:05:08 zoso, and the CORS error you get? 2014-05-15T15:05:25 looks like Host URL: localhost:5000 2014-05-15T15:06:33 zoso, okay. that should give a CORS error. saying the host names don't match. 2014-05-15T15:06:33 zoso, did you get anything like that? 2014-05-15T15:07:00 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5001/api/users/me?access_token=0gPjGM9ujFhvWG8ovjDMZzyTy746Vj. This can be fixed by moving the resource to the same domain or enabling CORS. 2014-05-15T15:07:09 zoso, hmm. but weird how do you get the 500 on the server then? 2014-05-15T15:07:15 zoso, can you try again. 2014-05-15T15:07:29 zoso, try the loading the swtr app, and try signing in again? 2014-05-15T15:07:43 yes, tried. Clearing cache and trying now 2014-05-15T15:08:15 zoso, same error? 2014-05-15T15:08:28 I keep getting logged out 2014-05-15T15:08:32 Yes same error 2014-05-15T15:08:37 logged out from persona 2014-05-15T15:09:06 and there is 500 and getCurrentUser too 2014-05-15T15:09:11 ecthiender, ^ 2014-05-15T15:09:46 zoso, try updating the host url with http 2014-05-15T15:10:00 and then try again and see if it works. zoso 2014-05-15T15:10:16 ecthiender, done that, do you have a slash at the end like http://localhost:5000/ 2014-05-15T15:10:33 no. 2014-05-15T15:11:12 ecthiender, here is what the /users/me/apps displays 2014-05-15T15:11:13 zoso, I get a CORS error as well in FF. But fetching annotations work for me. 2014-05-15T15:11:14 Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:5001/api/sweets/q?where=http%3A%2F%2Ffarm3.staticflickr.com%2F2861%2F12592657843_46fff3dedf_n.jpg&access_token=cHzsO6B383qgaK5RAPGUD0iNLt6jHU. This can be fixed by moving the resource to the same domain or enabling CORS. 2014-05-15T15:11:14 sweetr 2014-05-15T15:11:14 Annotation of content objects on web. 2014-05-15T15:11:14 APP ID: bOKYc8mDEZkif8E8U73BDpTAa9Ke849u6pAQZBDl 2014-05-15T15:11:14 APP Secret: vYopPSXwEG9s1zwTM7DIdARU4bEpwqgkI3qJvoBqNh51inG23R 2014-05-15T15:11:14 Host URL: http://localhost:5000 2014-05-15T15:11:16 Redirect URL: http://localhost:5000/ 2014-05-15T15:11:18 Scopes: email, sweet, context 2014-05-15T15:11:46 I think CORS is not related to our issue here 2014-05-15T15:11:55 zoso, yeah. 2014-05-15T15:11:57 I think the problem is the 500 2014-05-15T15:12:17 so we should find out why getCurrentUser is whining :P 2014-05-15T15:12:34 zoso, when you load the app, do you type http://localhost:5000 or http://localhost:5000/ 2014-05-15T15:12:34 ? 2014-05-15T15:13:30 ecthiender, I do it without a slash, but after you asked, I tried both, and same results 2014-05-15T15:13:45 should do it w/o slash. 2014-05-15T15:13:56 that matches the name you provided in the sweet store. 2014-05-15T15:13:58 anyway.. 2014-05-15T15:14:29 and you get same error, saying it takes 1 argument and 0 given? 2014-05-15T15:14:32 zoso, ^ 2014-05-15T15:14:44 ecthiender, yes 2014-05-15T15:14:50 zoso, how is it compaining it takes 1 argument? :P 2014-05-15T15:15:01 in the definition itself there are no arguments? 2014-05-15T15:15:16 s/?/. 2014-05-15T15:15:26 and I keep getting logged out of persona after the error happens, I need to go to sweet store and hit login again 2014-05-15T15:17:04 zoso, you can login in to sweet store via the swtr app as well. 2014-05-15T15:17:39 zoso, but there is an issue there. when you sign in through swtr, you get logged out at the sweet store page. haven't been able to find out why. 2014-05-15T15:17:57 zoso, but that's ok. its a UX issue. the thing should work. 2014-05-15T15:19:16 ecthiender, can I call you 2014-05-15T15:19:24 zoso, yeah. 2014-05-15T15:55:08 *** zoso has quit IRC (Read error: Connection reset by peer) 2014-05-15T17:21:14 *** ecthiender has quit IRC (Quit: gotta go)