Re: CD Burning

2006-04-05 Thread Tim Golden
Albert Leibbrandt wrote:
 Hi

 Can anybody tell me which windows API or python module they are using
 for writing cd's / dvd's with python?

Other people have offered sound suggestions about using
cdrecord etc. under Cygwin. Just to make the point, though,
XP (and above, presumably) does have an inbuilt interface
for burning CDs. I've never used it, and I don't know how feasible
it would be to access it from Python. (Helpful, eh?)

The interface is ICDBurn and it should be possible to wrap
it with ctypes / ctypes.com but I haven't the time at the
moment to try it out. (And I haven't a CD writer in this machine
either!)

Ultimately, it might still be easier to install Cygwin and use
the cdrecord approach. I just wanted to make the point that
there *was* an in-built mechanism.

ICDBurn:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/icdburn/icdburn.asp
ctypes.com: http://starship.python.net/crew/theller/ctypes/com.html

TJG

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


Re: CD Burning

2006-04-05 Thread Gregory Piñero
Nero has a commandline utility called NeroCMD.exe  (not sure if you
needed a free solution or not)

Here's some sample code and write-up using NeroCMD.exe with Python:
http://www.answermysearches.com/index.php/nerocmdexe-and-python-automating-the-burning-process/10/

-Greg

On 5 Apr 2006 00:46:16 -0700, Tim Golden
[EMAIL PROTECTED] wrote:
 Albert Leibbrandt wrote:
  Hi
 
  Can anybody tell me which windows API or python module they are using
  for writing cd's / dvd's with python?

 Other people have offered sound suggestions about using
 cdrecord etc. under Cygwin. Just to make the point, though,
 XP (and above, presumably) does have an inbuilt interface
 for burning CDs. I've never used it, and I don't know how feasible
 it would be to access it from Python. (Helpful, eh?)

 The interface is ICDBurn and it should be possible to wrap
 it with ctypes / ctypes.com but I haven't the time at the
 moment to try it out. (And I haven't a CD writer in this machine
 either!)

 Ultimately, it might still be easier to install Cygwin and use
 the cdrecord approach. I just wanted to make the point that
 there *was* an in-built mechanism.

 ICDBurn:
 http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/ifaces/icdburn/icdburn.asp
 ctypes.com: http://starship.python.net/crew/theller/ctypes/com.html

 TJG

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



--
Gregory Piñero
Chief Innovation Officer
Blended Technologies
(www.blendedtechnologies.com)
-- 
http://mail.python.org/mailman/listinfo/python-list


CD Burning

2006-04-04 Thread Albert Leibbrandt
Hi

Can anybody tell me which windows API or python module they are using 
for writing cd's / dvd's with python?

Thanks
Albert

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


Re: CD Burning

2006-04-04 Thread Sybren Stuvel
Albert Leibbrandt enlightened us with:
 Can anybody tell me which windows API or python module they are
 using for writing cd's / dvd's with python?

I'd install cygwin and use cdrecord. That seems the easiest way to go
about burning disks to me.

Sybren
-- 
The problem with the world is stupidity. Not saying there should be a
capital punishment for stupidity, but why don't we just take the
safety labels off of everything and let the problem solve itself? 
 Frank Zappa
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: CD Burning

2006-04-04 Thread hugonz
Hi,

I used cdrecord, albeit on Linux, to do it. Someone already suggested
to use Cygwin for that.

I'll just drop a piece of code I wrote for getting the percentage of
advance when recording sound, with cdrecord. Here it is (wraps
cdrecord):

#!/usr/bin/env python

Canonizer: will open up a program and try to canonize its output.

Output is program dependent (different information is needed) but
always
canonical (messages are one line long, and parsable through splitting)

Currently only cdrecord will be implemented, but will be tailored for
anything.


Usage:

canonizer.py myprogram and options




import re
import sys
import os


track_regexp = re.compile(r^Track\s+(\d+):\s+(\d+)\s+of\s+(\d+))
total_regexp = re.compile(r^Total size:\s+(\d+))
fixating_regexp = re.compile(r^Fixating\.)
done_regexp = re.compile(r^Fixating time)


def loop_cdrecord(filep):
Loop over cdrecord's output
mycharbuf = 


exitstatus = 
burning = 0

#progress in Mbytes
progress = 0
newinterval = oldinterval = 0

while True:
data = filep.read(1)

if not data:
return exitstatus
mycharbuf+= data

if mycharbuf.endswith(\n) or mycharbuf.endswith(\r):
#sys.stdout.write(mycharbuf)
#sys.stdout.flush()
mycharbuf = mycharbuf[:-1]

if not burning:
try:
totalsize =
int(total_regexp.match(mycharbuf).group(1))
burning = 1
except:
pass
else:
if (track_regexp.search(mycharbuf)):
reobj = track_regexp.match(mycharbuf)
mytrack, mynum, mydem = reobj.group(1, 2, 3)
oldinterval = newinterval
newinterval = int(mynum)
if (oldinterval = newinterval):
progress += newinterval - oldinterval
else:
oldinterval = 0

print CAN_PERCENT = %d%((progress*98)/totalsize)

elif (fixating_regexp.search(mycharbuf)):
print CAN_PERCENT = %d%(98)
print CAN_FIXATING

elif (done_regexp.search(mycharbuf)):
progress = 100
print CAN_PERCENT = %d%(100)
exitstatus = ok
print CAN_DONE

sys.stdout.flush()

mycharbuf = 

commandline = 

#for i in sys.argv:
#print i

#Get the intended commandline
for i in sys.argv[1:]:
commandline +=   + i

pipe_filep = os.popen (commandline, r)

exitstatus = loop_cdrecord(pipe_filep)

if (exitstatus != ok):
print CAN_ERROR

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


cd burning

2006-03-31 Thread DK
i was wondering if there had been any recent development of python
modules that enables cd writing capabilities.

specifically, i'm looking to produce audio cds from ogg files on a
win32 envrionment.

any leads will be greatly appreciated...

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


Re: cd burning

2006-03-31 Thread RunLevelZero
I am hopeing something has developed myself.  I have been waiting
awhile.  I simply don't want to use cdrecord or cdrdao.  If I had the
know how I would be working on it but I believe this is a massive
undertaking and rather hard to accomplish.  I do hope this happens very
soon though.  Libburn might be of some use to you? I know FreeBSD
compiled some binding for python but the main libburn site only seems
to officially have ruby binding atm.  http://icculus.org/burn/.

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