IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1822.57 MB
Powered by
Channel Info
Network: freenodeChannel: #python |
Search in www.irclog.org
Log from #python at freenode 2006-05-20
[20:56]<dzjrpzjrrd>+Casanova: should no_of_docs be the total sum of all the lists of docs in all the LDTPUIManager objects?
[20:56]<crsrgjvr>+polpak: let me explain
[20:56]<fjffrc>+Casanova: please do =)
[20:56]<dzjrpzjrrd>+or is it just the number of docs for a single instance?
[20:56]<crsrgjvr>+each LDTPUIManager is a sepereate document :-) meaning a seperate window
[20:56]<crsrgjvr>+initially i will have 1 window
[20:56]<fjffrc>+Casanova: seems fine
[20:56]<crsrgjvr>+and then each time the user clicks on New a new window is opened
[20:57]<crsrgjvr>+so each LDTPUIManage refers to only 1 document no more!
[20:57]<fjffrc>+Casanova: ok
[20:57]<crsrgjvr>+i need to maintain the no of docs because i have to call gtk.main_quit() only when all the windows are closed
[20:57]<dzjrpzjrrd>+so in this case you coordinator might be something like MyApplication, which would keep a list of all the open windows/documents
[20:57]<sjuflzjlrrrvyjg>+Does anyone have any ideas?
[20:57]<fjffrc>+Casanova: so you want another manager to keep track of how many windows you have open
[20:58]<fjffrc>+Casanova: that is used to create new LDTPUIManager objectx
[20:58]<crsrgjvr>+polpak: yes
[20:58]<fjffrc>+Casanova: your New button should be tied to a method of this other manager class that creates a new LDTPUIManager object, and increments it's count of windows
[20:59]<crsrgjvr>+isnt global a much easier solution :D
[20:59]<fjffrc>+Casanova: no
[20:59]<dzjrpzjrrd>+no!
[20:59]<crsrgjvr>+hehe
[21:00]<fjffrc>+Casanova: cause at some point you might want sets of windows grouped together, and only want to exit when all the groups are closed
[21:00]<crsrgjvr>+just out of curiosity how do i make a variable static?
[21:00]<2smgv2jm2mjjm>+casa: you don't
[21:00]<crsrgjvr>+bsmntbombdood: i dont what?
[21:00]<fjffrc>+Casanova: you're rigidly coupling your windows to the application
[21:01]<2smgv2jm2mjjm>+you dont make a variable static
[21:01]<crsrgjvr>+bsmntbombdood: ironfroggy said it is possible :-/
[21:02]<dzjrpzjrrd>+no i didnt.
[21:02]<crsrgjvr>+<Casanova> cant i create a static variable in a class?
[21:02]<crsrgjvr>+<ironfroggy> Casanova: you can, but they are best for other purposes.
[21:02]<dzjrpzjrrd>+Casanova: one second. i will show something.
[21:02]<crsrgjvr>+ok
[21:02]<zjzdd>+there are at least two possible hacks to get C-like static variables; one uses nested scopes, the other overrides __call__. Neither is especially pretty.
[21:02]<dzjrpzjrrd>+not static like C static.
[21:06]<dzjrpzjrrd>+ok ive updated your paste to show what you could do
[21:06]<dzjrpzjrrd>+wait...
[21:07]<dzjrpzjrrd>+ok, now ive updated it properly.
[21:08]<crsrgjvr>+ok
[21:11]<crsrgjvr>+ironfroggy: i willl check it out.. thanks a lot :-)
[21:14]<yjgnf_da>+how can you get the local timezone ?
[21:14]<pnnnnjd2yn>+ionel_mc: time.strftime("%Z")
[21:16]<sdyvxa>+if i have two classes (B,C) which inherit from the same class(A), and in one of those classes(B), i need to determine if the final class (which could inherit from either or both of those) inherit from C, how would i do that? isinstance() doesn't seem to work
[21:16]<zjzdd>+tried issubclass?
[21:16]<sdyvxa>+roryy: no; one moment
[21:18]<zndd>+hi.. I want to create a python module to extract audio tracks from cdrom and put them in wav files... Can i do that in Python or i have to create a C module ? :/
[21:19]<c2zjjcs>+remy: you can do that in python
[21:19]<sdyvxa>+roryy: if issubclass(self, AutoPackageRecipe) gives me:
[21:19]<sdyvxa>+TypeError: issubclass() arg 1 must be a class
[21:20]<c2zjjcs>+ah, its you smithj
[21:20]<dzjrpzjrrd>+i dont understand why you cant use isinstance
[21:20]<zjzdd>+smithj: in that case isinstance should work
[21:20]<sdyvxa>+kbrooks: ken?
[21:20]<zjzdd>+smithj: i thought you were trying to check classes, from your original statement
[21:20]<c2zjjcs>+smithj: im kyle :P i remember you :P
[21:20]<zndd>+kbrooks: oh good.. do you know where i can find documentation about this? (access to a device cdrom and read it..)
[21:21]<c2zjjcs>+remy: on linux, its easy. just os.chdir() to the CD mountpoint
[21:21]<c2zjjcs>+remy: windows too, os.chdir("D:\")
[21:21]<c2zjjcs>+you can use os.listdir()
[21:22]<zjzdd>+(strings shouldn't end with \)
[21:22]<sdyvxa>+roryy: i agree isinstance should work, but it returns False when I try to inherit from both B and C
[21:22]<zndd>+kbrooks: ok thanks. I'm on NetBSD, it will be the same... I will do that
[21:22]<c2zjjcs>+rocky: is D: valid, then?
[21:22]<zjacd>+kbrooks: tab-completion snafu ?
[21:23]<c2zjjcs>+ryes
[21:23]<c2zjjcs>+roryy: is D: valid, then?
[21:23]<zjzdd>+kbrooks: dunno, sorry
[21:25]<zjzdd>+smithj: it works here with new- and old-style classes
[21:25]<yxrws>+smithj: and is B or C a Zope related class?
[21:25]<c2zjjcs>+Yhg1s: it isn't.
[21:25]<yxrws>+then isinstance() should work. are you sure you have an instance of whatever inherits from B and C?
[21:26]<zjzdd>+smithj: fwiw, this works with here: http://paste.ubuntu-nl.org/14345
[21:26]<zjzdd>+err
[21:26]<sdyvxa>+Yhg1s: no; thats the problem; i need to be able to tell *inside B* whether D inherits from C
[21:26]<zjzdd>+works here
[21:27]<c2zjjcs>+roryy: fwiw?
[21:27]<zjzdd>+it's inuit for 'i don't know if this is helpful or not'
[21:28]<yxrws>+smithj: yes.
[21:28]<sdyvxa>+kbrooks: for what its worth
[21:28]<yxrws>+smithj: you need to know of something whether it inherits from C. You can't know that unless you *have something* that inherits from C.
[21:28]<yxrws>+smithj: if you don't have something that inherits from C, isinstance() obviously won't claim it inherits from C.
[21:29]<yxrws>+so, how sure are you your failing testcase does indeed involve an instance that inherits from C?
[21:29]<sdyvxa>+i'm pretty sure since the class specifically inherits from both, but how can i be more sure?
[21:30]<yxrws>+inspect the instance you feed to B's isinstance-using function. check its class, check the class's bases.
[21:30]<yxrws>+or pastebin the code and let us have a look.
[21:30]<yxrws>+also make sure you inherit from *the same* C class. For instance, if reload() is involved, you can get confusing failures.
[21:33]<zjzdd>+do Zope classes destroy the ability to use isinstance ?
[21:33]<sdyvxa>+one moment while i pastebin it
[21:34]<yxrws>+the old Zope 'extensionclasses' use antique metaclass hacks (predating Python 2.2) that don't work with isinstance().
[21:34]<zjzdd>+huh
[21:38]<sdyvxa>+http://conary.pastebin.com/728547
[21:39]<yxrws>+smithj: since methods get an instance (the first argument, normally called 'self', not 'r'), you would have to call 'isinstance', not 'issubclass'.
[21:40]<sdyvxa>+Yhg1s: i realize its normally called self, but there is a wierd thing around here for calling it r sometimes *shrug*
[21:40]<zjzdd>+(i told him to use issubclass earlier, when i thought he was dealing with classes)
[21:41]<yxrws>+the paste doesn't contain enough information, though; if I was to imagine the missing parts, it'd just work. So something outside of the paste is causing it.
[21:41]<sdyvxa>+Yhg1s: well, i'd be happy to provide the rest, but then it becomes rather large
[21:41]<yxrws>+for instance, _AbstractPackageRecipe could be a weird class, with a custom metaclass. Or RPMPackageRecipe's setup() could never be called.
[21:42]<sdyvxa>+and i tried isinstance a long time ago and it also didn't work
[21:42]<yxrws>+and what does 'loadSuperClass' do? does it modify any of the classes?
[21:42]<sdyvxa>+Yhg1s: no, it just loads them from a repository if they're not stored locally







