[PATCH 07/10] Fix issues in the AnacondaWidgets python wrapper

David Shea dshea at redhat.com
Wed Sep 25 19:16:03 UTC 2013


On 09/25/2013 02:47 PM, Vratislav Podzimek wrote:
> On Wed, 2013-09-25 at 14:21 -0400, David Shea wrote:
>> Switch to absolute module names for importing the gi data. Besides
>> breaking the pylint check, using relative imports meant that
>> AnacondaWidgets.py could only be used when installed.
>>
>> Add an __init__ for AnacondaWidgets.TimezoneMap
>> ---
>>   widgets/python/AnacondaWidgets.py | 7 +++++--
>>   1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/widgets/python/AnacondaWidgets.py b/widgets/python/AnacondaWidgets.py
>> index 9b268a5..512eb5e 100644
>> --- a/widgets/python/AnacondaWidgets.py
>> +++ b/widgets/python/AnacondaWidgets.py
>> @@ -24,8 +24,8 @@ where necessary.  For instance instead of creating a class and then
>>   setting a bunch of properties, these classes allow passing the properties
>>   at creation time.
>>   """
>> -from ..importer import modules
>> -from ..overrides import override
>> +from gi.importer import modules
>> +from gi.overrides import override
>>   
>>   Anaconda = modules['AnacondaWidgets']._introspection_module
>>   __all__ = []
>> @@ -78,6 +78,9 @@ DiskOverview = override(DiskOverview)
>>   __all__.append('DiskOverview')
>>   
>>   class TimezoneMap(Anaconda.TimezoneMap):
>> +    def __init__(self):
>> +        Anaconda.TimezoneMap.__init__(self)
>> +
> What is this __init__ good for? Wouldn't it be the same if it was
> omitted?
>
It's good for making the error go away :-)  I'll switch this to a 
disable-msg=W0232. The only reason it's warning us here is because the 
parent class is coming out of gi, so pylint thinks there is no parent 
constructor.


More information about the anaconda-patches mailing list