*** dcmwai has quit IRC *** reinhard has joined #gnuenterprise *** reinhard_ has joined #gnuenterprise *** reinhard has quit IRC *** johannesV has joined #gnuenterprise morgen *** sjc has joined #gnuenterprise *** dcmwai has joined #gnuenterprise *** btami has joined #gnuenterprise reinhard: xchat-2: einstellungen - optionen - Schnittstelle | Eingabezeile *** dcmwai has quit IRC *** kilo_ has joined #gnuenterprise *** mixi has joined #gnuenterprise *** _mixi__ has quit IRC *** dcmwai has joined #gnuenterprise *** kilo_ has quit IRC *** mixi has quit IRC *** _mixi_ has joined #gnuenterprise *** kilo_ has joined #gnuenterprise *** btami has quit IRC *** dcmwai has quit IRC *** holycow has quit IRC *** holycow has joined #gnuenterprise *** kilo_ has quit IRC *** kilo_ has joined #gnuenterprise cd grrr somehow gnome doesn't display the window that has the focus on top *** sjc has quit IRC reinhard: does it change focus with mouse being over a window? kilo_: no you just click on a windows and it doesnt display it? it usually happens when i switch virtual desktops so after i switch to a desktop, xchat window has the focus but xterm window is displayed on top cd yeah for example just now :) oh yes, it is usual it is not a bug, it is a feature 8-)))) :) *** ajmitch has quit IRC *** ajmitch has joined #gnuenterprise *** SachaS has joined #gnuenterprise *** SachaS has quit IRC *** SachaS has joined #gnuenterprise *** SachaS has joined #gnuenterprise *** SachaS has joined #gnuenterprise hi everyone hi SachaS hi kilo_ *** kilo_ has quit IRC *** dsmith has joined #gnuenterprise *** jamest has joined #gnuenterprise *** holycow has quit IRC *** johannesV_ has joined #gnuenterprise *** johannesV has quit IRC hallo reinhard, hallo johannesV_ see ya in a minute *** SachaS has quit IRC *** SachaS has joined #gnuenterprise *** reinhard_ has joined #gnuenterprise *** reinhard has quit IRC *** jcater has joined #gnuenterprise * derek straps jcater down *** dcmwai has joined #gnuenterprise *** Morphous has joined #gnuenterprise vcs err * chillywilly covers his eyes as he is not into bondage bondage? *** Amorphous has quit IRC reinhard: 10:10 * derek straps jcater down sounds kinky to me ah ok ew *** Vee has quit IRC *** V has joined #gnuenterprise *** johannesV_ has quit IRC *** sjc has joined #gnuenterprise im fighting python data structures and looking for help if i have a something like you shouldn't fight em 5000 5010 5015 5020 5025 and i need to capture information what im wanting is something like a dictionary that contains values like 5000, 6000, 7000 then when you hit the key '5000' it needs to contain description and a list of valid keys for the level 2 dictionary so if looked at myDict['5000'] i would be able to get the "description" of 5000 as well as a list of valid keys for myDict2 i did some assignment in loops but the problem was the myDict2 was not specific to the "parent" key value so was loading all valid level2 i am not seeing how to make a dict contain more than one value per key and doing with multiple dicts i keep hitting the wall of the dict really has to be dynamic which doesnt work well i think using setdefault i can set multiple values but i dont have the "labels" that a dict provides creates additional problems * derek needs to find some documentation on lists {'masterKey': {'subkey': value, 'subkey':value}, 'masterKey': {}} or in your case that is what i want i.e. that is almost identical to the notes on my desk {'masterKey': {'values': {'key':value,'key',value}, 'description':value} } i just cant freaking python dicts to store data that way :) where values and description are hard coded exactly now if i could get python to let me do that i would be happy :) i'm completely lost as that is perfectly valid python minus any typo's of course one thing you can do key='5000' myDict[key] = {'values': {}, description="My data joo fewlz!"} *** dcmwai has quit IRC subkey = 'bar' myDict[key]['values'][subkey] = 'foo' bingo that is the syntax i needed myDict[xxx][xxx]= another example of nested dicts can be found in any of gnue's GParser stuff i think i will still have my dynamic dict issue but let me take this sytanx and try somethig you can be as dynamic as you want as long as you don't copy the same dict under multiple keys example data = {'foo':'bar'} myDict[key]['values'] = data myDict[key2]['values'] = data in that case both store refs to the same data dict you'd instead want to do a deepcopy operation (examples in GFParser.py IIRC) let me look at somethign and come back and ask more questions this way i dont overwhelm myself :) doesnt help we are in new building and they are literally jackhammering non stop outside my window or that computers hate you yeah nesting dicts like this is very handy but can get ungodly confusing to read so i was using setdefault to avoid duplication of keys switched to def addLvlOne(level1, org, desc): level1[org]['description'] = desc and now i get a key error duplicate key is there a way to use "setdefault" or is it better to try to trap key error? doing the following fixes it, but dont know if its good python form or not def addLvlOne(level1, org, desc): try: level1[org]['description'] = desc except KeyError: pass why would that give a key error? grrr something is not right i get blank dict why.. because the loop is going to set that value multiple times * derek needs to revisit something else sigh its because there is a parent on top of that 5000 so it really can be 501 5000 or 502 5000 but at this point there is a rule that regardless of teh top parent the children must "roll" consistently" but not all parents contain all children so i have to read all parents in order to assure i find all the children so in this example 500 ad 5001 ah er 500 and 501 both have 5000 so need to load it hang on but the second time i need to "skip" it as it already exists hmm doing a print myDict yeilds a {} try: print("%s : %s") % (org, desc) level1[org]['description'] = desc except KeyError: pass print level1 prints {} >>> def addLvlOne(level1, org, desc): ... try: ... level1[org]['description'] = desc ... except KeyError: ... level1[org] = {'description': desc, ... 'values':{}} ... >>> dict={} >>> addLvlOne(dict,"my","data") >>> addLvlOne(dict,"your","stuff") >>> import pprint >>> pp = pprint.PrettyPrinter(indent=4) >>> pp.pprint(dict) { 'my': {'values': {}, 'description': 'data'}, 'your': {'values': {}, 'description': 'stuff'}} >>> addLvlOne(dict,"my","word") >>> pp.pprint(dict) { 'my': {'values': {}, 'description': 'word'}, 'your': {'values': {}, 'description': 'stuff'}} i hate not being able to print from thsi machine... grrr now i dont get blanks but something aint quite right dumb question how do you define a global nevermind foudn it.. problem was trying to define global and assign to it on same line ... duh jamest: okay i think im grokking this now for the 50 dollar question if i have { u'5001': {'values': {}, 'description': u'ADMINISTRATION '}, how do i set 'values'? as a list? and maybe you answered this above myDict['5001']['values'] = 'foo' would set the value no? but how do i make that value a list? myDict['5001']['values'] = ['foo','bar','baby'] or empty myDict['5001']['values'] = [] then myDict['5001']['values'].append('foo') myDict['5001']['values'].append('bar') bingo myDict['5001']['values'].append('baby!') that is what i was looking for.. .append what's AZ pay an hour for IRC tech support? why on earth they dont give list syntax in the python docs (or at least readily easy to find) is beyond me well i dont have my GOOD python book with me * jamest is tryig to get out of some manual labor at the house :) otherwise i wouldnt ask here the python docs rock all i have is damn "cookbook" bah the python tutorial has a section on lists and dicts i like them most of the time, but find it hard to find things like dict and lists i looked a tthe tut section on lists and it sucked and the library ref it has a full section on dicts and lists doh.. under chapter 2.3 http://www.python.org/doc/2.3.3/tut/node5.html#SECTION005140000000000000000 was what i was reading now i see at the bottom is does show an .append but says little about it same doc chapter 5 http://www.python.org/doc/2.3.3/tut/node7.html $645 for the entire X12 EDI transaction set lame chillywilly: i suppose you want it for free? damn hippie coders yeeeeeeeep okay i think i have the structure loaded (YEAH) now the bitch will be unloading it :) *** reinhard has quit IRC *** reinhard has joined #gnuenterprise *** ogger has joined #gnuenterprise *** wayneg has quit IRC *** wayneg has joined #gnuenterprise *** Vee2d2 has quit IRC *** Vee2d2 has joined #gnuenterprise hallo reinhard SachaS: hi bad day today the council of the EU just has passed the software patents directive :( thats special i thought the majority of the EU population was against it or was that only the majority of the tech worker minority reinhard, wasn't there an understaning of not passing them? does the EU political system follow the same guiding principles as the US one Money Talks the majority of the EU population doesn't care actually because they don't see the issues *** kilo_ has joined #gnuenterprise and they get told it only affects "those open source freaks" however decisions in the EU are not *that* easy now the parliament again has to vote whether it agrees with the council or not it's a very complicated process kilo_: is there any visible resistance against software patents in hungary? was this a main topic in Sweden? when the next vote will be in the parliament, hungarian members will also vote SachaS: it was one of the topics of course however there are so many topics concerning free software that we must be very careful in the fsfeurope to "waste" all our resources on a single battle and loosing the war meanwhile to "not" waste ... err yes of course :) reinhard: there was an interpellation in the parliament the other day, and the officer from the ministry of information technology said, that the ministry is against software patents and our foreign minister should vote against them in the European Council the smaller party in the ruling coalition is clearly against software patents as they say it is not liberal, so a liberal party can only vote against them cool however hungary voted for software patents today :-( which means they were fooled by bolkenstein money talks then who always tells the current directive doesn't allow software patents package deal... you votes 'yes' and we give you money... *** Vee2d2 has quit IRC *** SachaS has quit IRC that's depressing *** dsmith has quit IRC sounds as fun as the USA jamest : fwiw reading those values back was VERY easy have pretty little org charts now :) like 5001 ADMINISTRATION 5001 ADMINISTRATION DETAIL 5015 FINANCIAL MGMT BUREAU 5016 CFO ADMINISTRATION 5017 BUDGET 5019 FINANCIAL SERVICES 5021 PROPERTY MANAGEMENT 5023 WAREHOUSE OPERATIONS 5025 MCSO CENTRALIZED COST 5027 PROCUREMENT 5950 SHERIFF DONATION FUND * sjc is depressed with todays news derek: should be sjc, any news in particular or just in general? yes, the EU software patent news 5950 SHERIFF DONATION FUND that just reads wrong =) what is the opposite T account for that? DONUT FUND? wondered why they submitted the form as 5950 SHERIFF DONUT NATION FUND we thought they just couldnt spell * derek notes important to note that deputy sheriff was at one time well over 300lbs why does every channel seem to discuss food these days :) what else would we discuss? jamest: what can be done to gain commit access? kilo_:sacrifice a small animal *** Vee2d2 has joined #gnuenterprise rodents work, but goats are better neighbor's goat? jcater: I dont know.... software perhaps? :) kilo_: is it not working? i had it svn up'n about 20 minutes ago didn't try commit havent received anthing regarding my commit access yet i have received email and written mail from fsf, all signed ok, i think we'll just have to trust you as I don't know anyone w/ access to the fsf computers atm i can set it up tonight but I have to leave here in about 2 minutes for an appointment ok, np i assume username == kilo seems good ok bbl *** jamest has left #gnuenterprise *** havoc has quit IRC *** nickr_ has joined #gnuenterprise *** nickr has quit IRC *** reinhard_ has joined #gnuenterprise *** ogger has quit IRC *** reinhard has quit IRC *** reinhard_ has quit IRC *** kilo_ has quit IRC *** jcater has quit IRC *** sjc has quit IRC *** havoc has joined #gnuenterprise *** jcater has joined #gnuenterprise *** jamest has joined #gnuenterprise *** mixi has joined #gnuenterprise *** _mixi_ has quit IRC *** jcater has quit IRC *** dcmwai has joined #gnuenterprise *** jcater has joined #gnuenterprise *** jamest has quit IRC *** mdean has joined #gnuenterprise *** jcater has quit IRC