[elbe-devel] [PATCH 38/40] pylint: fstab - rename variables

Torben Hohn torben.hohn at linutronix.de
Thu Sep 20 13:52:45 CEST 2018


On Fri, Sep 14, 2018 at 01:56:50PM +0200, Manuel Traut wrote:
> to avoid
> 
> fstab.py:46, PyLint, Priority: Normal
> Redefining name 'fstabentry' from outer scope (line 72)
> 
> fstab.py:76, PyLint, Priority: Normal
> Redefining built-in 'id'
> 
> Signed-off-by: Manuel Traut <manut at linutronix.de>

Reviewed-by: Torben Hohn <torben.hohn at linutronix.de>

> ---
>  elbepack/fstab.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/elbepack/fstab.py b/elbepack/fstab.py
> index 5e9bb8de..d81b9528 100644
> --- a/elbepack/fstab.py
> +++ b/elbepack/fstab.py
> @@ -43,14 +43,14 @@ class mountpoint_dict (dict):
>          dict.__init__(self)
>          self.id_count = 0
>  
> -    def register(self, fstabentry):
> -        mp = fstabentry.mountpoint
> +    def register(self, fstab_entry):
> +        mp = fstab_entry.mountpoint
>  
>          if mp in self:
> -            fstabentry.id = self[mp].id
> +            fstab_entry.id = self[mp].id
>          else:
> -            fstabentry.id = str(self.id_count)
> -            self[mp] = fstabentry
> +            fstab_entry.id = str(self.id_count)
> +            self[mp] = fstab_entry
>              self.id_count += 1
>  
>      @staticmethod
> @@ -73,7 +73,7 @@ class fstabentry(object):
>  
>      # pylint: disable=too-many-instance-attributes
>  
> -    def __init__(self, xml, entry, id=0):
> +    def __init__(self, xml, entry, fsid=0):
>          if entry.has("source"):
>              self.source = entry.text("source")
>          else:
> @@ -97,7 +97,7 @@ class fstabentry(object):
>          self.partnum = 0
>          self.number = ''
>  
> -        self.id = str(id)
> +        self.id = str(fsid)
>  
>      def get_str(self):
>          return "%s %s %s %s 0 %s\n" % (self.source, self.mountpoint,
> -- 
> 2.19.0.rc2
> 

-- 
Torben Hohn
Linutronix GmbH | Bahnhofstrasse 3 | D-88690 Uhldingen-Mühlhofen
Phone: +49 7556 25 999 18; Fax.: +49 7556 25 999 99

Hinweise zum Datenschutz finden Sie hier (Informations on data privacy 
can be found here): https://linutronix.de/kontakt/Datenschutz.php

Linutronix GmbH | Firmensitz (Registered Office): Uhldingen-Mühlhofen | 
Registergericht (Registration Court): Amtsgericht Freiburg i.Br., HRB700 
806 | Geschäftsführer (Managing Directors): Heinz Egger, Thomas Gleixner
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.linutronix.de/pipermail/elbe-devel/attachments/20180920/262972d3/attachment.sig>


More information about the elbe-devel mailing list