FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Design Team

 
 
LinkBack Thread Tools
 
Old 08-18-2011, 02:26 PM
Ales Kozumplik
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

We discussed getting rid of this 'constant variable' in
https://www.redhat.com/archives/anaconda-devel-list/2011-August/msg00196.html.

This is my first attempt, separated into three patches to make it clear
what is the mechanical rewrite and where something has been done. I will
probably squash those three before pushing if noone objects.

I plan pushing this after F16 is branched.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-18-2011, 07:51 PM
Chris Lumens
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

> We discussed getting rid of this 'constant variable' in
> https://www.redhat.com/archives/anaconda-devel-list/2011-August/msg00196.html.
>
> This is my first attempt, separated into three patches to make it clear
> what is the mechanical rewrite and where something has been done. I will
> probably squash those three before pushing if noone objects.
>
> I plan pushing this after F16 is branched.

You alluded to this in patch #2, but I didn't see a real answer. Are
you able to completely remove anaconda as a parameter to functions now?
Even better, can you keep going up a level and removing anaconda as a
parameter to functions that only required it to in turn pass
anaconda.rootPath?

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-19-2011, 09:06 AM
Ales Kozumplik
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

On 08/18/2011 09:51 PM, Chris Lumens wrote:

You alluded to this in patch #2, but I didn't see a real answer. Are
you able to completely remove anaconda as a parameter to functions now?


Yes! And I am planning to write myself a simple parser (or use
python-lint or similar) that finds those functions automatically ---
since anaconda.rootPath no longer exists I can just detect if a function
still uses anaconda.something and if not then the anaconda parameter
might be superfluous. (doesn't hold for overloaded functions for example
but it is a good first seed).



Even better, can you keep going up a level and removing anaconda as a
parameter to functions that only required it to in turn pass
anaconda.rootPath?


Those will be find the same way as above: when 'anaconda' was only used
for 'anaconda.rootPath' such reference is now gone and the anaconda
parameter is unused.


So it is going to take a couple of iterations and I will probably miss
places but getting rid of a variable when we know it's a constant should
be a good thing by itself, no?


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-25-2011, 01:03 PM
Ales Kozumplik
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

On 08/18/2011 09:51 PM, Chris Lumens wrote:

We discussed getting rid of this 'constant variable' in
https://www.redhat.com/archives/anaconda-devel-list/2011-August/msg00196.html.

This is my first attempt, separated into three patches to make it clear
what is the mechanical rewrite and where something has been done. I will
probably squash those three before pushing if noone objects.

I plan pushing this after F16 is branched.


You alluded to this in patch #2, but I didn't see a real answer. Are
you able to completely remove anaconda as a parameter to functions now?
Even better, can you keep going up a level and removing anaconda as a
parameter to functions that only required it to in turn pass
anaconda.rootPath?

- Chris



I removed many unnecessary instances of instRoot passing, to keep the
changes more transparent I separated them into patches per file where
the function is defined. It is a lot of boring patches so I uploaded
them to github:


https://github.com/akozumpl/anaconda/commits/rootpath

If you'll want to extensively comment (I don't expect it) let me know
and I'll send the patches to the list. I plan to merge them all in one
or two patches before pushing.


Also unfortunately it turned out there is only very few instances where
'anaconda' can be removed: this is also because many times 'anaconda' is
in the argument list of a callback (like the functions dispatcher
dispatches to), or of a derived class which doesn't make use of it.


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-25-2011, 03:06 PM
Chris Lumens
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

> I removed many unnecessary instances of instRoot passing, to keep
> the changes more transparent I separated them into patches per file
> where the function is defined. It is a lot of boring patches so I
> uploaded them to github:
>
> https://github.com/akozumpl/anaconda/commits/rootpath
>
> If you'll want to extensively comment (I don't expect it) let me
> know and I'll send the patches to the list. I plan to merge them all
> in one or two patches before pushing.
>
> Also unfortunately it turned out there is only very few instances
> where 'anaconda' can be removed: this is also because many times
> 'anaconda' is in the argument list of a callback (like the functions
> dispatcher dispatches to), or of a derived class which doesn't make
> use of it.

You're right, those are pretty boring patches. A quick glance through
them looked fine to me, and if there's any problem we can let pylint
catch it.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 08-26-2011, 07:37 AM
Ales Kozumplik
 
Default anaconda.rootPath -> pyanaconda.constants.ROOT_PATH

On 08/25/2011 05:06 PM, Chris Lumens wrote:

You're right, those are pretty boring patches. A quick glance through
them looked fine to me, and if there's any problem we can let pylint
catch it.

- Chris


I ran pylint (using tests/pylint/runpylint.sh) two times, once with and
once without my patches and the diff between the two outputs shows only
line numbers changed. Also I can install interactively, through
kickstart and upgrade interactively. UTs are greener than ever. Will
push this today after I've merged the commits into only two or three.


Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:31 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org