*** bigbrother has joined #gnuenterprise *** bigbrother has joined #gnuenterprise beats me had to restart a few things on ash lack of donuts let me run this by someone since my feeble mind is so rusty btamis list box works if i had a structure with 3 levels 3000 3000 3001 *** kilo_ has joined #gnuenterprise 3000 3001 3002 for example i need to build a stucture to hold them so i can write out hierarchy of them 3000 3001 3002 i have column that tells me what "level" something is hi so i was thinking if i rolled through the resultset one time i could create a dict with key being the level 1 (in this sample 3000) then when rolling in the level 2 it could store the values in level 1 dict as that is in the record and so on so have a dict with two dicts in it but i am not sure if that is making it more complicated than it has to be nah basic python is there possibly an elegant python solution i am missing do it all the time do you have to initialize a dict? before you can start to populate it @version Vee: The current (running) version of this Supybot is 0.77.1. The newest version available online is 0.77.2. foo = {} then inside whatever for loop you have traversing the resultset try: currentCategory = foo[category] except KeyError: currentCategory = {} foo[category] = currentCategory then you can reference currentCategory as that categories dict category == my wording for your 3000, 3001, etc that's how jcater does it at least are you following? or do you need a better, more concrete example ? im not sure i entirely follow, but htat is just cause im having to look at some python syntax if you have concrete example great, if not i can figure it out not handy no prob here is a question resultset = datasource.createResultSet(conditions={"fisc_year": year}) works but how would i do something like resultset = datasource.createResultSet(conditions={"fisc_year": year, "agency" : agency}) i.e. i need to add an AND in there and is implicit when you specify conditions that way how would you do OR? you won't like the answer build a condition tree though we do support pass-thru sql now hmmm it doesnt like agency = '50%' i.e. it doesnt do wildcards or am i mistaken agency = '50%' and agency like '50%' are two different things do hang on... h my bad liking how easy it was started ignoring syntax :) SachaS: fwiw it was broke for me too. ok. dsmith, now is fine. yes, anon svn server was down doh wait.. i didnt have option to specify jcater: What did you restart? svnserve some day we should move that to inetd ok fwiw, you could also do DataSourceWrapper(sql="""select foo from bar where name like 'dneig%'""") though that wouldn't work with appserver, et al I don't recommand that for cross-database projects but do use it internally you still get a resultset back for this script, that might be just as easy i would like to do it "right" way but if right way isnt implemented yet i could do the sql= right way is implemented you just don't get the convenience of the {} syntax so how would you do right way hmm if it is overly complex i willuse sql= but would that be easiest way may be to do createResultSet(conditions=GConditions.buildConditionFromDict({ ...}, coparison=GConditions.GClike)) DataSourceWrapper(connections, sql="""myquery""") or c/coparison/comparison/ DataSourceWrapper(sql="""myquery""") the former hmm GConditions not defined... guess we need an import statement yes gnue.common.datasources.GConditions hmmm i spelled something wrong i think doh its buildCondition not buildConditions class GConditions has no attribute 'buildConditionFromDict' *** dsmith has quit IRC hmmm the code is there def buildConditionFromDict (dictionary, comparison = GCeq, logic = GCand): oh what's your import? looks like you went one level too deep, and imported the GCondition class out of the GCondition module instead of importing the GCondition module from gnue.common.datasources.GConditions import * i tried import gnue.common.datasources.GConditions as well *** dsmith has joined #gnuenterprise from gnue.common.datasources import GConditions different error now checking syntax import problem fixed though yeah its workign other than the import was pretty simple now i just need to load my dicts and im near golden jcater: my problem i think is more complicated than i had hoped as not only do i need 3000 3001 3004 i need an additional value how do you do elseif in python elif doh that explains why the 40 other combos i used didnt work :) *** dsmith has quit IRC *** jcater has quit IRC *** kilo_ has quit IRC *** jamest has left #gnuenterprise *** sjc has left #gnuenterprise has anyone seen btami or kilo or know wheter svn for windows works? *** reinhard has joined #gnuenterprise hmmm no jcater here if anybody sees jcater i think the gnue-common/src/cursing directory in svn misses at least one file ScreenContainer.py seems to have been removed and I see no other file taking over its parts thanks reinhard do you have winXP laying around? or anyone for that matter? i need fsutils.exe and linkd.exe they ship on XP and are available on Win2k3 Free Reosource kit i am in sweden, fsfe meeting sitting on the floor in the living room of some guy here :) off to sleep l8r all *** reinhard has quit IRC i found fsutil.exe on xp but no linkd.exe grrr *** jcater has joined #gnuenterprise *** tatoo has joined #gnuenterprise hi everybody! Look Boss! The plane, the plane! hi courier now working smoothly :) i used the duncan font in my terminal and with my font does anybody know a women's channel? i'm not kidding my girlfriend wanna know. i could hardly see the difference between . and , : took me a while to catch it. night all *** SachaS has left #gnuenterprise *** tatoo has quit IRC *** dcmwai has joined #gnuenterprise *** wayneg has quit IRC *** wayneg has joined #gnuenterprise *** holycow has joined #gnuenterprise *** dcmwai has quit IRC *** jcater has quit IRC *** holy_cow has joined #gnuenterprise *** holy_cow has quit IRC *** _mixi_ has joined #gnuenterprise