IRC log of #schooltool for Thursday, 2013-07-18

*** replaceafill has quit IRC00:58
*** replaceafill has joined #schooltool01:11
*** replaceafill has quit IRC01:44
*** menesis has quit IRC01:52
*** menesis has joined #schooltool09:07
*** menesis has quit IRC09:58
*** menesis has joined #schooltool13:54
*** pgulley has joined #schooltool15:15
*** pgulley has quit IRC15:40
*** th1a has joined #schooltool16:31
th1aHi yvl, menesis.16:32
th1aI guess we're waiting for replaceafill.16:32
menesishi.16:33
th1amenesis: I just forwarded thanks from a supervisor user for your ppa fix.16:33
menesisI got it myself16:34
yvlgood morning16:34
menesissent to schooltool-owners I guess16:34
th1aAh.16:34
menesisnice :)16:34
menesisbut I still have to submit the patch to debian16:35
th1aThere is always more for the package manager to do.16:35
th1ayvl: Where can I find lazr.restful docs?16:37
yvlumm16:38
th1aSo there are some folks in South Africa interested in doing a mobile client.16:38
yvldidn't look for them yet16:38
th1ahttp://www.mlab.co.za16:38
th1aWell, if I want to understand it more, where should I look?  Just at your branch?16:39
th1aI can find it in their code.16:40
yvlhttp://bazaar.launchpad.net/~lazr-developers/lazr.restful/trunk/files/head:/src/lazr/restful/docs/16:40
yvland client here: http://bazaar.launchpad.net/~lazr-developers/lazr.restfulclient/trunk/files/head:/src/lazr/restfulclient/docs/16:40
th1aOK.  Thanks.16:41
th1aSo if nothing else, that gives Aaron a little extra motivation (and the rest of us) on the web services side.16:41
th1aI'm not sure if they've actually done any real planning on what they'd like to do, but I'm trying to push them in the direction of an attendance client first.16:42
*** replaceafill has joined #schooltool16:42
replaceafillgood morning/afternoon16:42
th1ahi replaceafill .16:42
replaceafillsorry i'm late (no internet for a while)16:43
th1anp16:43
th1aOK, yvl, would you like to start?16:43
yvlsure16:43
yvlwell, not much to say16:43
yvlpushed...16:43
yvlbzr+ssh://bazaar.launchpad.net/~justas-pov/schooltool/schooltool.rest/16:44
yvljust an example REST api for person16:44
yvl(s)16:44
yvloh, along the way I added a debugdb script to schooltool.devtools16:45
yvlso if you add it to [scripts] in buildout16:45
yvlyou can use it to get interactive shell with open ST db and all components loaded16:45
yvlwhat else..16:46
yvlmoving along with relationship statuses16:46
replaceafillyvl, components as in adapters, utilities, etc?16:46
yvlyes16:46
replaceafillyvl, hhmm i have a question related to that16:46
replaceafillbut sorry for interrupting16:47
yvllistening16:47
replaceafilli'm working on the script for loading the grades for the malawi school16:47
replaceafilland i used zope.component's provideAdapter and provideUtility16:47
replaceafillin order to use ISchoolToolApplication(None) for example, etc16:48
replaceafillbut i got to a dead end on the IntIds utility16:48
replaceafillwhich i think is local in the app site manager, correct?16:48
yvlyes16:49
replaceafilli need the IntIds utility because the ISectionContainer adapter for terms uses intids16:49
yvlso you can now do this16:49
replaceafillmaybe your new script could help?16:49
replaceafilli mean, the interactive shell part16:49
yvlfrom schooltool.devtools.database import open_database16:49
replaceafilloh16:50
yvldb = open_database(config="xxx", with_components=True)16:50
yvlconfig is path to schooltool.conf16:50
replaceafillbut this is in trunk right :(16:50
replaceafilland this script needs to run with deb packages16:50
replaceafilli mean, the malawi script16:50
yvlthen:16:50
yvl        root = connection.root()16:50
yvl        app = root[ZopePublication.root_name]16:50
yvl        oldsite = getSite()16:50
yvl        setSite(app)16:50
yvloh ,16:50
menesisthis is in devtools. that is not packaged.16:51
yvlconnection = db.open()16:51
yvlok16:51
replaceafillyvl, that's what i did16:51
yvlwell then16:51
yvljust copy the Machinery from http://bazaar.launchpad.net/~schooltool-owners/schooltool.devtools/trunk/view/head:/src/schooltool/devtools/database.py16:51
yvlthat should work if refactored SchoolToolMachinery is packaged already16:52
replaceafillah ok16:52
menesis SchoolToolMachinery is only in trunk, not 2.416:52
replaceafillthis is how i've been registering stuff i've needed: http://pastebin.com/q11pR5L416:53
replaceafillyou can see how i tried to get the intids from the app's sitemanager16:53
replaceafillignore lines 11-13 :) i was just testing it16:53
yvl:)16:53
yvlwell, it would be better to load with ZConfig16:53
replaceafillthat would give me the whole environment?16:54
replaceafilli'm confused that this setSite(app) approach works for evolution scripts16:55
replaceafillwe even have evolve scripts that use getUtility(IIntIds) with no problem16:55
yvlumm16:56
yvlwell, ISchoolToolApplication adapter returns current site16:56
yvlbut evolution does have all the components loaded16:56
yvlhmm16:57
yvlfor old ST16:57
yvlyou basically neeed16:57
yvlhttp://bazaar.launchpad.net/~schooltool-owners/schooltool/2.3/view/head:/src/schooltool/app/main.py#L77216:57
yvlStandaloneServer16:57
yvland these lines:16:57
yvl        options = self.load_options(argv)16:57
yvl        db = self.setup(options)16:57
yvlthen open db, get root, set site16:58
yvldo your thing16:58
yvlcommit transaction16:58
yvland close everything16:58
yvl(db, connection)16:58
replaceafillok16:59
yvlok17:00
yvlso not much else form me today17:00
yvlin progress :)17:01
th1aDoes that get you unstuck replaceafill?17:01
replaceafilli'm reading through that code right now17:01
replaceafillchecking whe the setup part does17:02
replaceafillwhat*17:02
yvlwell it does some extra crap17:03
yvllike setting up logging and such17:03
replaceafilli think this is the part giving me headaches:17:03
replaceafillsetUpUtilities(app, [UtilitySpecification(IntIds, IIntIds)])17:03
menesissm = app.getSiteManager()17:03
menesissm.registerUtility(IntIds(), IIntIds)17:03
replaceafillthat makes the utility persistent in the site manager, right?17:04
menesisI think does the same17:04
yvlIIRC, yes17:04
replaceafillif i understand the utility correctly, it has the ids for all the objects created in the db17:04
yvlyes17:05
replaceafilli tried creating a new IntIds(), like menesis example17:05
replaceafillbut it was obviously empty17:05
menesisright, this is done only in bootstrapSchoolTool17:05
replaceafilland this hack works:17:05
replaceafillprovideUtility(sm.getUtility(IIntIds), IIntIds)17:05
yvlalso, you could just load all of the machinery17:06
yvlthat would save you this headache17:06
replaceafillyvl, all of the machinery?17:06
yvlALL machinery17:06
replaceafillyou mean using your branch as model?17:06
yvland also maybe protect you from accidently forgetting some subscriber that does data consistency17:06
yvlumm, yes?17:06
yvlbut actually17:07
yvljust17:07
yvlfrom schooltool.app.main import StandaloneServer17:07
yvlserver = StandaloneServer()17:07
yvlserver.load_options(argv)17:07
yvldb = server.setup(options)17:07
yvlnow, if you want, you can extract parts of .setup17:08
replaceafillah, i understand now17:08
yvl        self.siteConfigFile = options.config.site_definition17:08
yvl        self.configure(options)17:08
th1aYou also don't have to do this in one self contained script if we have newer libraries that would help.  You can zip up some other stuff if that would help.17:08
yvl        db_configuration = options.config.database17:08
yvl        try:17:08
yvl            db = db_configuration.open()17:08
yvl        notify(DatabaseOpened(db))17:08
yvl        self.startApplication(db)17:09
yvl        provideUtility(db, IDatabase)17:09
yvland that's it17:09
replaceafillthat would load all the adapters, utilities for me?17:09
yvlyep17:09
replaceafillno site setup and stuff in my script17:10
replaceafillcool17:10
yvlumm17:10
yvlyou'll still need to set the site17:10
yvlthis only gets you components and d17:10
yvldb17:10
replaceafillah ok17:10
yvlyou need to open connection, get root, get app, setSite(app)17:10
replaceafillsetting the site is not hard anyway :)17:10
replaceafillyes17:10
yvlbegin the transaction, do stuff17:10
yvlthen commit, close connection, close db :)17:10
replaceafillright17:11
replaceafilldamn persistent intids :D17:11
yvl:D17:11
th1aOK.  We set?  There is no point in rushing these conversations because it saves time in the long run.17:13
replaceafillth1a, i think i can move forward now17:14
replaceafillat least i'll try ;)17:14
th1aSo relationship statuses yvl?17:15
yvlwell, they are in progress17:16
yvlit is a bit tricky, so will still be doing that part on Mon I think17:16
yvlit's to be expected when one wants to add extra dimension to one's data :)17:17
th1aSure.17:17
th1aOK.  Thanks yvl .17:18
th1areplaceafill?17:18
replaceafillwell, other than my intids problem17:18
replaceafillthe script is almost complete17:19
replaceafilli made a few decisions:17:19
th1aGood!17:20
*** replaceafill_ has joined #schooltool17:21
*** replaceafill_ has joined #schooltool17:21
replaceafill_ggrr, sorry guys17:21
*** replaceafill has quit IRC17:21
*** replaceafill_ is now known as replaceafill17:21
replaceafillso i was saying i made a few decisions in the script logic i wanted to share:17:22
replaceafill* script will look for Grades worksheet17:22
replaceafill* grades are treated as text and converted to integers17:22
th1areport sheet?17:22
replaceafillno the XLS sheet17:22
replaceafillin jonathan's sample17:23
replaceafillhe sent a xls with 3 sheets17:23
replaceafilljust the first one has grades17:23
th1aOK.17:23
replaceafilland since i used our importer logic (which looks for a specific worksheet name), i decided to use Grades17:23
replaceafill* the report sheet template created by the script is titled Grades, this is17:24
replaceafill  also the title used to deploy the report sheet to each section17:24
replaceafill...since everything needs a title17:24
replaceafillthis could be easily changed to allow jonathan to set them through options ofc17:24
replaceafilland last,17:24
replaceafill* the report sheet template is deployed to every term in every school year17:24
replaceafillhere's where i hit the intids (when deploying the report sheets)17:25
replaceafillother than that, the importer works (on its own)17:25
replaceafillah, also, everything to the right of the student id is considered a grade column17:26
replaceafillso he can add more columns if needed17:26
th1aYou'll just need to write that down for him.17:26
replaceafillyes17:26
replaceafilland... that's it17:27
replaceafilli'll try to have it done today17:27
replaceafilland send him the instructions17:27
th1aOK.  Cool.17:28
th1aThanks replaceafill.  We need some practice on this kind of thing because hopefully we'll be doing a lot more.17:28
th1amenesis?17:29
menesisI have worked on other project last two days17:29
menesisso nothing to report17:30
th1aOK.  Thanks menesis .17:30
th1aThis was a good week in general for random queries.17:31
th1aSome weeks it seems like nobody is using SchoolTool and we're all doomed.17:31
th1aThis week has been livelier, although it is impossible to tell which random queries will amount to anything.17:31
th1aBut at least enough to feel like we may have a future.  ;-)17:32
replaceafillwe got a question from Chile :)17:32
replaceafillhttps://answers.launchpad.net/schooltool/+question/23257117:32
replaceafillhe says "schooltool is great..."17:32
replaceafill:)17:32
th1aAh, cool.17:33
th1aOK.  We'll meet Monday at the regular time.17:35
th1aThanks guys!17:35
th1aHave a good week/end.17:35
* th1a drops the bag of gravel.17:35
yvlthanks guys17:35
yvlsee you soon :)17:36
*** yvl has quit IRC17:36
replaceafillthanks everybody17:36
*** th1a has quit IRC18:46
*** th1a has joined #schooltool18:50
*** th1a has quit IRC20:04
*** menesis has quit IRC20:12
*** th1a has joined #schooltool20:34
*** menesis has joined #schooltool20:39
replaceafillth1a, i think i'm done with the script :)21:07
*** th1a has quit IRC21:08
*** th1a has joined #schooltool21:21
th1ahi replaceafill21:21
replaceafillhey th1a21:21
th1aAre you sending it off?21:21
replaceafilli'm going to test my spreadsheets in a raring instance21:21
replaceafillyes21:21
replaceafillbut i want to test the hardcoded stuff (paths mostly) before21:22
replaceafillwith the debs21:22
replaceafillth1a, http://pastebin.com/39QvkPuW21:27
replaceafilli hope that makes sense for Jonathan21:27
th1aDo you tell him what to actually do with it?21:32
replaceafillyes21:33
replaceafillstop service, run script (this way), start service21:33
replaceafillit works with debs btw21:33
th1aOK.  Good.21:33
replaceafillth1a, http://pastebin.com/efvejHYq21:44
replaceafillmakes sense?21:44
th1aI'd just add that if you have any data in your database you're worried about you should back it up.21:48
th1aHe's just testing though.21:48
replaceafillah, right21:48
replaceafillth1a, email sent21:51
* replaceafill goes to get lunch, bb in ~1h21:54
*** th1a has quit IRC21:59
*** th1a has joined #schooltool22:22
*** th1a has quit IRC22:42
*** th1a has joined #schooltool22:47

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!