Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Development (http://www.linux-archive.org/archlinux-development/)
-   -   The script sections should operate on an AnacondaKSScript instance (#728468). (http://www.linux-archive.org/archlinux-development/562465-script-sections-should-operate-anacondaksscript-instance-728468-a.html)

Martin Gracik 08-10-2011 07:06 AM

The script sections should operate on an AnacondaKSScript instance (#728468).
 
On Tue, 2011-08-09 at 14:07 -0400, Chris Lumens wrote:
> This is necessary to make sure they have a run method.
> ---
> pyanaconda/kickstart.py | 8 +++++++-
> 1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
> index 9a8b636..15a46b2 100644
> --- a/pyanaconda/kickstart.py
> +++ b/pyanaconda/kickstart.py
> @@ -51,7 +51,7 @@ from pykickstart.base import KickstartCommand, BaseData
> from pykickstart.constants import *
> from pykickstart.errors import formatErrorMsg, KickstartError, KickstartValueError, KickstartParseError
> from pykickstart.parser import Group, KickstartParser, Packages, Script
> -from pykickstart.sections import PreScriptSection, NullSection
> +from pykickstart.sections import *

Why do you use import * so much?
Otherwise everything looks good.

> from pykickstart.version import returnClassForVersion
>
> import gettext
> @@ -1259,6 +1259,12 @@ class AnacondaKSParser(KickstartParser):
> self.handler.add(retval)
> return retval
>
> + def setupSections(self):
> + self.registerSection(PreScriptSection(self.handler , dataObj=AnacondaKSScript))
> + self.registerSection(PostScriptSection(self.handle r, dataObj=AnacondaKSScript))
> + self.registerSection(TracebackScriptSection(self.h andler, dataObj=AnacondaKSScript))
> + self.registerSection(PackageSection(self.handler))
> +
> def doKickstart(anaconda):
> storage.storageInitialize(anaconda)
> # Having initialized storage, we can apply all the other kickstart commands.

--
Martin Gracik <mgracik@redhat.com>

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

Chris Lumens 08-10-2011 01:50 PM

The script sections should operate on an AnacondaKSScript instance (#728468).
 
> > +from pykickstart.sections import *
>
> Why do you use import * so much?
> Otherwise everything looks good.

Because I want to import everything from pykickstart.sections.

- Chris

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

Martin Gracik 08-10-2011 02:07 PM

The script sections should operate on an AnacondaKSScript instance (#728468).
 
--

Martin Gracik

----- Original Message -----
> > > +from pykickstart.sections import *
> >
> > Why do you use import * so much?
> > Otherwise everything looks good.
>
> Because I want to import everything from pykickstart.sections.

I understand what you want to achieve. But you also import * from constants, and all these * imports are cluttering the namespace, and then it's hard to see right away what names come from what modules.

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

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


All times are GMT. The time now is 10:58 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.