openembedded-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] contrib: oe-stylize: Fix ambiguous variable names
@ 2023-06-02 13:57 niko.mauno
  2023-06-02 13:57 ` [PATCH 2/2] contrib: oe-stylize: Use Python3 explicitly niko.mauno
  0 siblings, 1 reply; 2+ messages in thread
From: niko.mauno @ 2023-06-02 13:57 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Niko Mauno

From: Niko Mauno <niko.mauno@vaisala.com>

Fix pycodestyle warnings:

  oe-stylize.py:439:9: E741 ambiguous variable name 'l'
  oe-stylize.py:449:17: E741 ambiguous variable name 'l'

by switching iterator variables to non-ambiguous characters.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 contrib/oe-stylize.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/oe-stylize.py b/contrib/oe-stylize.py
index 30b460e12..1ef6391b6 100755
--- a/contrib/oe-stylize.py
+++ b/contrib/oe-stylize.py
@@ -436,8 +436,8 @@ if __name__ == "__main__":
     # -- dump the sanitized .bb file --
     addEmptyLine = False
     # write comments that are not related to variables nor routines
-    for l in commentBloc:
-        olines.append(l)
+    for c in commentBloc:
+        olines.append(c)
     # write variables and routines
     previourVarPrefix = "unknown"
     for k in OE_vars:
@@ -446,8 +446,8 @@ if __name__ == "__main__":
         if seen_vars[k] != []:
             if addEmptyLine and not k.startswith(previourVarPrefix):
                 olines.append("")
-            for l in seen_vars[k]:
-                olines.append(l)
+            for s in seen_vars[k]:
+                olines.append(s)
             previourVarPrefix = k.split('_')[0] == '' and "unknown" or k.split('_')[0]
     for line in olines:
         print(line)
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] contrib: oe-stylize: Use Python3 explicitly
  2023-06-02 13:57 [PATCH 1/2] contrib: oe-stylize: Fix ambiguous variable names niko.mauno
@ 2023-06-02 13:57 ` niko.mauno
  0 siblings, 0 replies; 2+ messages in thread
From: niko.mauno @ 2023-06-02 13:57 UTC (permalink / raw)
  To: openembedded-devel; +Cc: Niko Mauno

From: Niko Mauno <niko.mauno@vaisala.com>

For instance on Debian based host OS 'python' is not provided by
default, which results is following error when trying to execute
oe-stylize.py script:

  /usr/bin/env: ‘python’: No such file or directory

Update the shebang to explicitly reference 'python3' instead of
'python', which should make the script better out-of-the-box
compatible with larger variety of host OSes on which Yocto based
development work takes place.

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
---
 contrib/oe-stylize.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/oe-stylize.py b/contrib/oe-stylize.py
index 1ef6391b6..1fb0a5bcc 100755
--- a/contrib/oe-stylize.py
+++ b/contrib/oe-stylize.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 
 """\
 Sanitize a bitbake file following the OpenEmbedded style guidelines,
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-02 13:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02 13:57 [PATCH 1/2] contrib: oe-stylize: Fix ambiguous variable names niko.mauno
2023-06-02 13:57 ` [PATCH 2/2] contrib: oe-stylize: Use Python3 explicitly niko.mauno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).