IRC log of #schooltool for Thursday, 2012-07-12

th1areplaceafill:  For the node sorting, we should probably just take a couple minutes and make a little guessing heuristic to decide which one is most important (the one referred to most overall, say) and then for each unique set of parent nodes say "The most important one and 3 others" and maybe show them all in a tooltip.00:42
replaceafilli think dwelsh will go after the "core" and "additional" parts00:44
replaceafillthat's the way "cando 2011" sorts them00:44
th1aWell, that gets into what we really don't know in the new model.00:44
th1aWe just should guess based on frequency and sort that way too.00:44
th1aHe'll never know the difference, it is just a little extra work for us.00:45
replaceafillwill you be around the rest of the week?00:45
replaceafilli think i'll get to that on friday00:45
th1aBut you know, computers are good at counting.00:45
th1aI'll be driving home Friday.00:45
th1aNot exactly sure when.00:46
th1aI'll let you know.00:46
replaceafillcool, i'll work on the other5 stories in the meantime :)00:46
th1aAlso, in the term filter view you could put in parentheses next to the term the number of sections.00:46
th1a[ ] Fall 2011 (5 sections)00:46
replaceafillkk, will do00:46
*** replaceafill has quit IRC02:33
*** th1a has quit IRC02:51
*** menesis has quit IRC04:08
*** th1a has joined #schooltool04:20
*** th1a has quit IRC05:14
*** th1a has joined #schooltool05:14
*** menesis has joined #schooltool09:16
*** menesis has quit IRC10:37
*** aelkner has joined #schooltool14:39
*** aelkner has quit IRC14:45
*** aelkner has joined #schooltool14:46
*** pgulley has joined #schooltool15:45
*** dreich has joined #schooltool15:45
*** replaceafill has joined #schooltool16:49
pgulleyreplaceafill, driech and I just wanted to check up with you17:07
replaceafillpgulley, can we talk in 30 mins? i'm getting breakfast17:08
pgulleysure, we're here17:08
replaceafillkk, bb in 3017:08
replaceafillpgulley, back17:25
pgulleyperfect. jelkner just mentioned that you had some concerns, we thought it was worth addressing17:25
replaceafillwell... as i told jelkner, maybe i should just go over the code and change some things i don't like17:26
replaceafilli haven't looked closely though17:26
dreichyou can tell us what you don't like, and we'll try to improve it17:26
replaceafillbut i would really appreciate if you add tests for the features you're developing17:27
dreichyeah, we've definitely gotten way ahead of ourselves17:27
pgulleyof course, jelkner and matt have beat that one into us, we're planning on feature-freezing after we address things today to get tests up to date17:27
replaceafillhaving a good test coverage would make easy for me or anyone else to get into the code17:27
replaceafilland change stuff17:27
replaceafillquick question17:28
replaceafillwhy do you need those init2 methods?17:28
replaceafillis it me, or are they for "postprocessing" the object once it's added?17:29
pgulleyyes, that's basically it17:29
pgulleyimages need a 'directory path'17:29
pgulleyso that the browser can access them. that doesn't exist until after they've been added17:29
replaceafilli think you could break that logic inside the object's class17:30
replaceafillbut again, it's easier to do it17:30
replaceafillcould they at least be renamed from "init2"?17:30
replaceafillto something more understandable17:30
dreichprocess_image_url, pgulley?17:30
pgulleyyes okay.17:30
replaceafillsince you're probably going to slow down now, with the feature-freeze, you should start working on your own branches17:31
replaceafilland do "full commits" with good comments17:32
replaceafillwhen i see "merged" as the commit message...17:32
replaceafillyou know, it's confusing17:32
replaceafillif i want to identify when you did what at what point17:32
dreichby "full commit", do you mean a new commit for each new test or feature we add?17:33
replaceafilldreich, i mean, a cleaner commit, one that doesn't have "prints" on it17:33
replaceafillone that when you see the diff, you don't get any debug noise17:33
dreichokay, right17:33
pgulleyah yes. because we're juggling code between the two of us it's often hard- we're working on features in parallel.17:34
replaceafillright, that's why i said "you're probably going to slow down now"17:34
replaceafillbut it's possible to go fast on your own branches17:34
replaceafillwe do it in schooltool17:34
pgulleywe'll keep the juggling in a separate branch, and only push to the main branch when things are clean, then?17:34
replaceafilladd pyflakes and pep8 to your dev environments17:35
replaceafillyou have moved a lot of code17:35
replaceafilland there are lots of unnecessary imports in the modules17:35
replaceafillget rid of those17:35
replaceafilli think pep8check is in the buildout17:36
replaceafillsrc/pyquiz/ E101 indentation contains mixed spaces and tabs17:36
replaceafillsmall things that make going through the code easier17:37
dreich:/  wow, that's not good17:37
replaceafilli know :/17:37
dreichyeah, thanks for reminding us17:37
replaceafillone thing i really don't want is to slow you down17:37
replaceafillbut as i think he told you, jelkner needs reliability on the new features17:37
dreichyeah, jelkner's slowing us down anyway17:38
dreichfor the best17:38
replaceafillso, do you know how to add a test?17:38
dreichwe've done so for subquizzes, but nothing else17:38
replaceafilli vote for small focused tests17:38
replaceafillmany of them17:38
replaceafillpyquiz is not huge anyway17:39
replaceafillso you can run the tests really quickly17:39
replaceafilltry to guarantee basic stuff first17:39
dreichi was modelling the subquiz test on quiz_management.txt, but yeah, that's a better idea17:39
replaceafilldreich, right, existing tests are not a good model probably17:39
replaceafillsee those huge unorganized narratives at the beginning17:40
replaceafillnot good17:40
replaceafillget rid of those remaining "import *" please17:40
dreichwhat else should we fix?17:43
*** replaceafill_ has joined #schooltool17:43
*** replaceafill_ has joined #schooltool17:43
*** replaceafill has quit IRC17:43
*** replaceafill_ is now known as replaceafill17:44
replaceafillsorry, got disconnected17:44
replaceafilldreich, pgulley could you tell me what new resources does pyquiz have?17:44
replaceafilli see a "bucket" now17:45
pgulleysubquizzes, too17:45
dreichyeah, the bucket's a new feature that just started being implemented when we decided to freeze17:45
dreichso I'm just cutting off user access to it for now17:46
replaceafillwhat is it for?17:46
dreichjoe youcha's user stories17:46
pgulleysharing questions between users outside of quizzes, basically17:46
dreichwe'll have 'buckets' of questions, from which random questions can be drawn to create quizzes17:46
replaceafillhmm ok17:47
pgulleyperhaps a better name is in order17:47
replaceafillto me, the title logic should go into the view17:49
replaceafillnot the resource17:49
replaceafillor at least a property on the object17:49
dreichI figured it would be good to keep there because it's seen in more than one view17:49
replaceafillthen use a property17:49
replaceafillnot the __init__17:50
dreichok, cool17:50
replaceafillwhat if jelkner comes tomorrow complaining about he wants 30 chars ...17:50
dreich....very good point17:51
replaceafillwhat about .index?17:51
replaceafillwhy is that needed?17:51
pgulleyanother part of the image directory path. that is another thing that can be stream-lined.17:51
pgulleywe discovered __name__ a bit after we implimented that, basically17:52
replaceafillpath_form = '/download'?17:53
pgulleyit is appended to and then stored as the image_url17:53
replaceafillis that for getting an url like:17:53
pgulleyso the final image_url is /download/
replaceafillso, if tomorrow i want to virtualhost several pyquizzes in the same server17:54
replaceafillall of them will point to the same path17:54
replaceafillor if i want to use
replaceafillthe path will still point to /download17:55
pgulleyno, no. only if they have the same url. it is then appended to the base pyquiz url in the template17:55
pgulleywith request.application_url17:56
replaceafillah ok17:56
replaceafillthe path still looks "funny" to me17:56
replaceafilllike it doesn't belong there17:57
replaceafillmaybe traversal could be use17:57
pgulleyit is a little bit of a clunky solution, yes.17:58
replaceafilldef duplicate(self, newparent)?17:58
replaceafillthat needs to be fixed17:58
replaceafilli wanted to use .copy for that17:58
dreichis used either to duplicate a question within a quiz or to copy it to a new quiz17:58
dreichwhat should I fix about the code?17:59
replaceafilldreich, you copy the existing object and attach it to any parent in the caller code17:59
replaceafillnot send the newparent17:59
replaceafillsomething like:17:59
replaceafillquestion = existing_question.copy(...)17:59
replaceafillnewparent[name] = question18:00
dreichbut for computing the image url using what's now called init2()18:00
dreichthe object needs to be added to its parent before init2() can be called18:00
replaceafillthen you probably need events18:00
replaceafillsee all your init2() calls in a lot of places18:00
replaceafillit puts responsability on a lot of callers18:01
replaceafillwhat if i create an object and forget to call "init2"18:01
replaceafillthat's why i say you may use traversal for that18:01
replaceafilltraversal is computed on request18:02
replaceafillyour paths seem fixed18:02
replaceafill(at first glance ofc)18:02
replaceafillto me "download" should be a container18:03
replaceafillor something like that18:03
replaceafillnot a string we use18:03
pgulleyI don't think so- download is really just a keyword and the files are stored on the objects18:03
pgulleyhaving a separate download container would be an unnecessary duplication.18:04
replaceafillwhy do you need the keyword again?18:04
pgulleyIt should be able to work with traversal how it is18:04
pgulleybecause if we point just to the object path it should be returning the object.18:05
pgulleydownload is caught by the url parser, then all the file serving is handled by one view18:05
replaceafilldownload is a view?18:05
pgulleynot exactly. but basically.18:05
pgulleyactually yes, for all intents it is18:06
dreichpgulley, you're the image guy, but I can't think of any reason not to make download a view explicitly18:06
pgulleyI mean there already is18:06
dreichwhy not
replaceafilloh my...18:07
replaceafillblob = context['quizzes'][rec['first']][rec['second']][rec['third']][rec['fourth']].image18:08
pgulleysorry about that18:08
pgulleyit's ugly.18:08
replaceafillit's the kind of code *i* write :/18:08
replaceafillthat's why i think it could be better :)18:08
pgulleydreich, because we don't want a separate download view for every object18:09
*** carthur has joined #schooltool18:09
replaceafillcan you explain downloadAttachment pgulley18:09
replaceafillpgulley, you could create one18:09
replaceafilldo we have a delete view?18:09
replaceafillin pyqui18:09
dreich(btw, replaceafill, carthur is an intern working with us, we've been teaching him python and pyramid)18:10
replaceafilldreich, excellent :)18:10
pgulleyso the url parser gets something in the form of 'download/{}/{}/{}...18:10
carthurHi replaceafill18:10
replaceafillhey carthur18:10
replaceafillnice to meet you18:10
carthuryou too18:10
replaceafillhope you're enjoying your pyramid learning :)18:10
replaceafillthese guys are really good, stick to them :D18:11
replaceafillpgulley, what if there's a 16th id?18:11
replaceafillnot possible? ;)18:11
pgulleyand any url in that form is passed to the download_attachment view.18:11
pgulleywell actually18:11
pgulleyI wanted to have a more extensible regular expression that could handle any number of id's18:12
pgulleybut pyramid didn't like it very much18:12
pgulleythe plan was to revist it eventually18:12
replaceafillpgulley, ok18:12
replaceafilladd tests for it first18:13
replaceafillthen you can axe it the way you want18:13
pgulleyright, tests are the first priority here18:13
replaceafillok, i'll go through the code deeply during the weekend18:14
replaceafilltwo days ago18:14
replaceafilli tried to run the app, and got an .index related error in a view18:14
pgulleydo you remember which view? it may've been a subquiz thing where we hadn't completely merged the features18:14
replaceafillpgulley, i was trying to update grades i think18:15
replaceafilli dont remember exactly, sorry18:15
replaceafillpgulley, dreich use login.txt as a model for your tests18:15
replaceafillthat one could be easily be login1.txt, login2.txt, etc18:16
replaceafillmy point is that each part tries to test a use case of the login view18:16
dreichbut we shouldn't actually split them to their atoms?18:16
dreichonly close?18:16
replaceafillsplit them is better imho18:17
replaceafillall those browser in login.txt are independent too18:17
pgulleyso one browser object per test.18:18
replaceafillif you think the test data needs to be improved, do it18:18
dreichany reason to not split the existing tests, like login.txt, while we're at it?18:18
replaceafilldreich, feel free to18:18
replaceafilljust make sure you don't miss something while splitting18:18
replaceafilldreich, also18:18
replaceafillthere are helpers for those tests18:18
replaceafilllike addPerson18:19
dreichyes, they're awesome18:19
replaceafilladd as much as you can18:19
replaceafillso your test focus on exactly one thing18:19
replaceafillinstead of going through all the forms to add a couple of questions18:19
replaceafillwhen you want to test is the "duplicate" view18:19
dreichok, avoid redundant tests18:20
replaceafillok, i think that's it from me18:20
replaceafilli'll probably have more questions for you next week18:20
replaceafillafter i understand your new architecture better18:20
replaceafilli'll create a branch for my changes and point you to it18:21
replaceafilland we can then discuss18:21
replaceafilljust for the record: i think you're doing a great job18:21
dreichawesome, thanks!18:21
dreichand i'm glad you think so, though maybe you won't once you look at the code better :P18:22
replaceafilllast thing18:22
pgulleyahhh yes18:22
dreichyes, we need help with that18:22
replaceafillat first, i wanted to have evolution the same way we do in schooltool18:23
replaceafillonce the server starts, the evolve scripts are run18:23
replaceafilland the data evolved18:23
replaceafillrepoze.evolution can help18:23
replaceafillbut then i saw the way the karl project handles evolution18:23
replaceafillthrough scripts18:23
replaceafilland i liked it18:23
replaceafillit's the same logic18:25
dreichwhat's karl written in?18:25
replaceafillpython :)18:25
replaceafillusing pyramid :)18:25
dreichoh, awesome!18:26
replaceafillso, basically, you create an utility for the manager18:26
dreichi was worried we were gonna have to translate some zope script or something18:26
dreichwhich is less fun18:26
replaceafillwhich contains the logic for the evolve18:26
dreichbut that's cool18:26
replaceafillyou can have as many evolve scripts as you need18:26
replaceafilland the evolution manager takes care of annotating the db18:27
replaceafillunfortunately it seems like the domain is down :(18:28
replaceafillbut you can install the egg from pypi18:28
replaceafillwhat do you need evolution for?18:29
dreichas of now, only for adding a new variable to quizzes18:31
pgulleyjeff's deployment is out-of-date18:31
dreichwhich has a perfectly sane default of [created_by]18:32
replaceafillmake it a class attribute18:32
replaceafilland make sure the callers set it18:33
replaceafillfor instance if you set it in the class as:18:33
replaceafillaccessible_by = None18:33
replaceafillmake sure the code that uses it understand None18:33
replaceafillin that case even if the existing instance doesnt have the attribute, it will get it from the class18:33
replaceafillyou use evolution for more complex stuff18:34
dreichthe problem is that as of now, they don't even have that attribute18:34
replaceafillagain, use a class attribute18:35
replaceafillnext time the code looks for:18:35
replaceafillit won't give you an error18:35
replaceafillwhat is accessible_by btw? :)18:35
dreichbut the first time the view looks for it and doesn't find it, it will give an error, right?18:36
dreich(and it's the list of teachers that can view the quiz, either because they created it or because it was shared with them)18:36
replaceafillhhmm, to me that should be a different component18:37
replaceafillsomething that handles that18:37
replaceafillwhich references to the quiz18:37
replaceafilllike [{'quiz': q1, 'teachers': [id1, id2, id3]}18:38
replaceafillor something like that18:38
replaceafilloutside the quiz18:38
dreichstored where then?18:38
replaceafillsome other container18:38
replaceafillyou could have more logic added to it18:39
replaceafillwithout affecting the quiz resource18:39
replaceafilli know it's yagni18:39
dreichi feel like just leaving it as an attribute is the simplest and smallest way to do it18:40
dreich(the teachers are being stored as usernames, not objects)18:40
replaceafilli understand18:40
replaceafilli just think it may get difficult to "extract" it18:41
replaceafillgoing back to the evolution part18:41
replaceafill"but the first time the view looks for it and doesn't find it, it will give an error, right?"18:41
replaceafillwhen the view tries to access the attribute and sees None, the view knows it's an "old" quiz18:41
replaceafilland can react18:41
replaceafillbut if you want to go with the evolve script, that's fine18:42
replaceafilli just think it's not necessary18:42
dreichok, cool, that works18:42
replaceafillok, guys, back to work for me18:43
dreichwe'll use karl's evolution eventually, but that's later18:43
dreichalright, we're off to work then!18:43
*** paulproteus has quit IRC19:00
*** paulproteus has joined #schooltool19:07
replaceafillth1a, zyt?19:47
*** carthur_ has joined #schooltool20:41
*** carthur has quit IRC20:41
*** pgulley has quit IRC20:59
*** dreich has quit IRC21:02
*** carthur_ has quit IRC21:12
*** dreich has joined #schooltool21:35
*** dreich has quit IRC22:38
*** replaceafill has quit IRC23:07
*** th1a has quit IRC23:57

Generated by 2.15.1 by Marius Gedminas - find it at!