|Firewing1||TFKyle: I think I found a decent solution|
TFKyle: main thread (the gui thread) calls the backup operation as a new thread
inside that, subprocess.Popen, non-blocking
|werneck||you call that decent ?|
|Firewing1||grab the Pid and just while loop it to check if it's active... If so, and "self.cancel == true" kill using PID|
not perfect but it will do for now
|werneck||use the GUI mainloop... it's the best solution... no threads|
|action||TFKyle dislikes using popen when there's python code to do something|
|TFKyle||dislikes using popen when there's python code to do something|
|Firewing1||werneck, but then don't I have to use gobject.idles?|
I need to have return values, and doesn't using only one thread disallow that?
|TFKyle||Firewing1: if you're using gtk it already uses gobject/GMainLoop|
you just register events and callbacks
|TFKyle||there's stuff to watch an fd in gobject's mainloop stuff I think|
|Firewing1||werneck, do you have a link on how to implement this?|
|TFKyle||though, not sure how it works for actually doing CPU work, if it's heavy it might require a GSource and liberal yeild'ing or something|
|werneck||unfortunally not... you can check twisted source code... but it's not hard to do... just check the event methods and how to implement a callback|
|Firewing1||k... For now I think I'll stick to the threads since it's working, but I'll change it to something more efficient later. Another blocker is I'd like to have tar, tar+gzip and direct copy as methods, and AFAIK there's no existing tar bindings for python|
but that's another adventure...
|TFKyle||Firewing1: the first 2 can be done by the tarfile module I think|
and the third os/shutil
|ferguscan||If I have four points in 2-d space, representative of 2 lines, what's the easiest way in Python to find the intersection of those two lines?|
|action||TFKyle wonders if numpy/scipy has stuff for that|
|TFKyle||wonders if numpy/scipy has stuff for that|
|ferguscan||TFKyle, not so important I guess. I'm already doing it myself. I was just wondering if I could reduce my code.|
|werneck||paste your code somewhere and maybe we can help you reducing it|
|ironfroggy||whats up with the python announcement feeds?|
im getting announcements for 2.4 final and PyCon05 Call for Proposals.
|kbrooks||ironfroggy, very unusual|
|Firewing1||Is win32api included by default in Windows Python isntalls?|
|dijix||Firewing1: I know it's in the ActiveState install|
|ironfroggy||its not part of the standard installer for windows, but i think it ought to be. the thing is, its outside of the standard library and will likely never be part of it.|
of course, ctypes covers a lot of things you'd need.
|Firewing1||ironfroggy, okay, so I'll use ctypes to kill processes on Windows|
makes less for users to install
|ironfroggy||whats the win32 call for process killing?|
so long as it has one, i dont know why os.kill wouldnt use it.
but if you are spawning your own processes, methods are being added to subprocess.Popen to do it more cleanly in killing them.