help on eval()-like but return module object

2006-01-12 Thread Dody Suria Wijaya
As I'm adding XMLRPC support in my apps, I'd like to send a module in server to be executed in client. My plan in sending the file content via xmlrpc, and doing compile + eval, but eval just execute the code object without returning the module. Original: import mymodule mymodule.run(request)

Re: IMAP4_SSL error

2006-01-05 Thread Dody Suria Wijaya
I recall that Active State Python binary does not include SSL because of export restriction. Try using normal python binary in http://python.org. Russell Stewart wrote: > I'm trying to log into a secure IMAP4 server using imaplib, > and I'm getting a strange error. If I do the following (name > o

Re: Application Portability?

2005-12-30 Thread Dody Suria Wijaya
from your story, it seems that your apps has client and application server separated by XMLRPC, which requires network connection all the time. Then based on this assumption, IMHO, the simplest way to port to PDA would be via web browser, which available natively on every PDA, and thus very eas

Re: python coding contest

2005-12-26 Thread Dody Suria Wijaya
omg, how do you guys do it? after 4 hours, i'm stucked at 182 chars, 8 lines. hint please... :D André Malo wrote: > * Tim Hochberg wrote: > >> Currently, I'm down to 137 characters now in 6 lines. There's very >> little left to trim at this point, so I don't know that I'll be able to >> knock it

Re: Python IMAP4 Memory Error

2005-12-23 Thread Dody Suria Wijaya
like magic it did the trick :D This should be applied to future Python release. Thanks. Fredrik Lundh wrote: > Jean-Paul Calderone wrote: > if you look at the debug output (which you may already have done), > it's an obvious case of fragmentation-inducing behaviour. any malloc- > based system ma

Re: Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Noah wrote: > This looks like a bug in your build of Python 2.4.2 for Windows. > Basically it means that C's malloc() function in the Python interpreter > failed. > On a second trial, it's also failed on Python 2.3.5 for Windows, Python 2.3.3 for Windows, and Python 2.2.3 for Windows. So this se

Re: Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Fredrik Lundh wrote: > try adding a print statement to lib/imaplib.py, just before that read > statement, > > print size, read, size-read > data = self.sslobj.read(size-read) > > and let us know what it prints. 14130601 0 14130601 14130601 16353 14114248 14130601 32737 14097864 1

Re: Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Mode details, this occurs on Python 2.4.2 windows, but not on Python 2.3.4 cygwin or Python 2.3.5 windows binary. Dody Suria Wijaya wrote: > > Hi, I encountered a Memory Error Exception on using IMAP4 just like in > Python documentation example, on a specially large email (10 MB). An

Python IMAP4 Memory Error

2005-12-22 Thread Dody Suria Wijaya
Hi, I encountered a Memory Error Exception on using IMAP4 just like in Python documentation example, on a specially large email (10 MB). Any idea how to fix/circumvent this? >>> typ, data = M.fetch(89, '(RFC822)') Traceback (most recent call last): File "", line 1, in ? File "C:\Python24

Re: Disable 'windows key'

2005-12-20 Thread Dody Suria Wijaya
But can it change "Fn" key mapping? Richie Hindle wrote: > [Paul] >> I wonder if there might be a way of disabling [the windows key] within >> my program. > > IHateThisKey will do this globally: > > http://www.bytegems.com/ihatethiskey.shtml > > The free edition blocks the Windows key, and th

Re: Adding methods to instances

2005-12-16 Thread Dody Suria Wijaya
To avoid that: - subclass Test first class SubclassTest(T): pass - assign the method to SubclassTest's attribute, SubclassTest.dynamic = dynamic - then assign the new class to magic variable __class__ : t.__class__ = SubclassTest t.dynamic() Antoon Pardon wrote: > But this will make the

Re: Self-awareness of imported modules? Do they know where they live?

2005-12-15 Thread Dody Suria Wijaya
import os print os.__file__ -- dsw -- http://mail.python.org/mailman/listinfo/python-list

Re: allow_none=True in SimpleXMLRPCServer

2005-12-14 Thread Dody Suria Wijaya
Hi, I faced the same same situation, and my quick problem solving was copying SimpleXMLRPCServer.py to current directory, and "patch" this line: response = xmlrpclib.dumps(response, methodresponse=1) into response = xmlrpclib.dumps(response, methodresponse=1, allow_none=True) Another better a

Re: Which Python web framework is most like Ruby on Rails?

2005-12-13 Thread Dody Suria Wijaya
Django is the closest one. [EMAIL PROTECTED] wrote: > I'm interested in knowing which Python web framework is most like Ruby > on Rails. > > I've heard of Subway and Django. > > > Are there other Rails clones in Python land I don't know about? > > Which one has largest community/buzz about it?

Keep-alived RPC in Python

2005-12-13 Thread Dody Suria Wijaya
I'm looking for a RPC library in Python that can keep its TCP connection alive for the duration of a user's login session. The reason is, each user login to the application server will impose a single dedicated database connection, and a TCP disconnect will indiciate application server to then

Re: problems binding a dictionary

2005-12-10 Thread Dody Suria Wijaya
[EMAIL PROTECTED] wrote: > this has to be a very silly thing. > > I have a function foo taking a dictionary as parameters. i.e.: def > foo(**kwargs): pass > when I call foo(param1='blah',param2='bleh',param3='blih') everything > is fine. > but when I do: def foo(**kwargs): > ... pass > ..

Re: newbie question

2005-12-10 Thread Dody Suria Wijaya
How about this: python your_program.py examle.txt Bermi wrote: > > how i can link it to read my file examle.txt? -- http://mail.python.org/mailman/listinfo/python-list

Re[5]: Get importer module from imported module

2005-02-07 Thread dody suria wijaya
dsw> New problem though. On line: dsw> newclass = new.classobj(classname + '_' + food, (mixin, main), {}) dsw> received "TypeError: metaclass conflict: the metaclass of a dsw> derived class must be a (non-strict) subclass of the dsw> metaclasses of all its bases". Oops, goofed up on me. The above

Re[4]: Get importer module from imported module

2005-02-07 Thread dody suria wijaya
ned when was written using 'normal' style like: class (SaltyMixIn, Main): pass -- dody suria wijaya YahooMsgr ID: dody Monday, February 7, 2005, 7:20:14 PM, you wrote: DB> dody suria wijaya wrote: >> "import a" inside b would not solve the problem, since there

Re[2]: Get importer module from imported module

2005-02-07 Thread dody suria wijaya
In,Main): pass # new class Sweet(SaltyMixIn,Main): pass # new but dislike it for personal taste; code dupes (there could be a lot of food flavouring), and sheer messiness. -- dody suria wijaya YahooMsgr ID: dody Monday, February 7, 2005, 6:10:14 PM, you wrote: DB> dody suria wi

Get importer module from imported module

2005-02-07 Thread dody suria wijaya
I found this problem when trying to split a module into two. Here's an example: == #Module a (a.py): from b import * class Main: pass == == #Module b (b.py) def How(): Main_instance = module_a.Main() return Main_instance == > import a > a.