RFC: new way to handle MOC files ?

Ulrich Kuettler ulrich.kuettler at mailbox.tu-dresden.de
Fri Feb 21 18:17:35 GMT 2003


On Friday 21 February 2003 18:51, Alexander Neundorf wrote:
> Hi,
>
> I wrote a small python script to help handling moc files in Makefiles.
> It's a third way additionally to the existing automagic stuff and qmake.
>

Hi:

I don't know whether this script is needed, but a few comments to the python 
code:

* In python you usually use four space indents. No tabs.
* The lines
	currentFile=file(mocName,"r")
	while True:
        	line=currentFile.readline();
                if len(line)<1 : break
		...

could be substituted with

	for line in file(mocName,"r"):
		...

* Instead of 'found=str.find(line,"include")' you'd better write 
'found=line.find("include")'

* And finally I don't get the difference between these two lines:
			startOfInclude=str.find(line,"\"")
                        endOfInclude=str.find(line,"\"")
But that's probably my fault.

Apart from that I appreciate the idea. ;)

Greetings,
Uli





More information about the kde-core-devel mailing list