No subject


Tue Jul 20 01:36:18 CEST 2010


line will vanish.

> 
> Another little issue i found is a naming problem - In portage.py there 
> is a new  function def get_packages_categories - in emerge function are 
> normally written in Camel Case with first character lowercase, so it 
> should be  def getPackagesCategories

Can fix that. For new code I prefer following PEP8 [1]. Is there an
official style guide for python code in emerge? Most of the stuff
I saw in emerge follows a C++/KDE alike and unpythonic style with
lots of redundant brackets. Should I adjust my code?

> 
> One extension I suggest is to change
> 
> def __str__(self):
> 140 	return "%s:%s:%s:%s" % (
> 141 	self.category, self.package, self.version, self.tag)
> 
> 
> into
> 
> def __str__(self):
> 140 	return "%s\\n%s\\n%s\\n%s" % (
> 141 	self.category, self.package, self.version, self.tag)
> 
> 
> which increases readability by printing each attribute in a new line. 
> Also with this change the graph is smaller in width. If you you forced 
> to use the original style, we should add a parameter to switch the 
> output format.

Okay, I'll write an explict output function to be used in the
dot visitor. The str() is used for other purposes too which I
don't want to break.

> Second I suggest to add an additional emerge command like
> 
> emerge --print-dependencies <package>
> 
> to make this features callable in the normal way.

That would be nice. The reason while I haven't done it is
the way the emerge.py driver is written. There is no
main() function and would the parsing of the
program parameters is done by hand. The options parsers
coming with python not used. I don't want to take
the same line. I clearly see potential for some refactoring
here. In my opinion that should be done after the merge.

> 
>> II - emerge -k
>>   
> I will take a look later

I re-read my yesterdays posting and recognized an error in my writing.
The correct call is:

  $ python bin\builder.py \
      -c "python emerge\bin\emerge.py %(category)s/%(package)s" \
      enterprise5/kdepim-e5 >> control.log 2>&1

like the 'emerge -j' call with the same '-c' semantic.

>> III - emerge -j
>>   
> I will take a look later

Forgot to mention that Python 2.6 is needed to use this
because we make use of the multiprocessing API.

>> You find our emerge changes in the intevation-merge branch [4].
>> It would be nice to have merged them back into trunk. :-)
>>  
> I will take some time for merging the stuff into trunk.

Andre Heinecke may assist you with this because he merged
all changes from trunk into our branch already.

> Many thanks for contributing this stuff.
> 

Thank you for testing. :-)

> Regards
>  Ralf

Regards,
  Sascha


[1] http://www.python.org/dev/peps/pep-0008/


More information about the Kde-windows mailing list