Re: Storing a callback function as a class member

2010-07-08 Thread Nathan Huesken
Hey,

Sorry, I tried to sent only the relevant parts of the example, but the
part where the error was, was left out.

I defined the function, used as callback like this:
class SomeClass:
def callback(param):
...

So I forgot the self parameter, and therefor the callback had a
different number of parameters than I expected.

Thanks for the effort!
Nathan

-- 
http://mail.python.org/mailman/listinfo/python-list


tarfile and progress information

2010-07-07 Thread Nathan Huesken
Hi,

I am packing large files with tarfile. Is there any way I can get
progress information while packing?

Thanks!
Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list


Storing a callback function as a class member

2010-07-07 Thread Nathan Huesken
Hi,

I have a class, where I want to store a callback function as a member
to access later:

class CallbackClass:
def setCallback(self,cb):
self.cb = cb

def callCallback(self, para):
self.cb(para)

Doing so, I get the error:
callbackFunc() takes exactly 1 parameter (2 given)

self is given as parameter this way, is it not? How can this be done?

Thanks!
Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list


importing modules from higher level directory

2010-06-25 Thread Nathan Huesken
Hi,

Is it somehow possible to import modules from *.py files in a higher
level directory?
Intuitively I would do

import ../module

but that does not work.
How does it work?

Thanks!
Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list


File descriptor to file object

2010-06-14 Thread Nathan Huesken
Hi,

tempfile.mkstemp returns a file name and a file descriptor (as returned
by os.open). Can I somehow convert this descriptor to a file object?

Thanks!
Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: FIle transfer over network - with Pyro?

2010-06-09 Thread Nathan Huesken
Thanks for all the replies.
I might use http, or I utilize a separate ftp server.

On Sat, 5 Jun 2010 13:34:45 -0700
geremy condra debat...@gmail.com wrote:

 On Sat, Jun 5, 2010 at 10:14 AM, Dan Stromberg strom...@gmail.com
 wrote:
  A more realistic answer is probably to use something based on
  HTTP. This solves a number of real-world problems, like the exact
  protocol to use over the network, and detecting network issues
  which cause the transfer to fail.  It also has the benefit that
  there's plenty of libraries already written to help you out.
 
  Didn't the OP request something fast?
 
 Nope. He pointed out that pyro is not efficient and asked what
 libraries we would use.
 
 OP: HTTP is a reasonable choice unless you need really extreme
 performance.
 
 Geremy Condra

-- 
http://mail.python.org/mailman/listinfo/python-list


FIle transfer over network - with Pyro?

2010-06-03 Thread Nathan Huesken
Hi,

I am writing a network application which needs from time to time do
file transfer (I am writing the server as well as the client).
For simple network messages, I use pyro because it is very comfortable.
But I suspect, that doing a file transfer is very inefficient over
pyro, am I right (the files are pretty big)?

I somehow need to ensure, that the client requesting a file transfer is
the same client getting the file. So some sort of authentication is
needed.

What library would you use to do the file transfer?
Regards,
Nathan
-- 
http://mail.python.org/mailman/listinfo/python-list