[oe-commits] Cliff Brake : update oe-stylize to be Python3 comaptible
git at git.openembedded.org
git at git.openembedded.org
Wed Dec 19 11:09:46 UTC 2012
Module: meta-openembedded.git
Branch: master
Commit: 20ce63275033b54c33c25fa1c60de7c1a0dc816c
URL: http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=20ce63275033b54c33c25fa1c60de7c1a0dc816c
Author: Cliff Brake <cbrake at bec-systems.com>
Date: Fri Dec 14 18:38:34 2012 +0000
update oe-stylize to be Python3 comaptible
Signed-off-by: Cliff Brake <cbrake at bec-systems.com>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>
---
contrib/oe-stylize.py | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/contrib/oe-stylize.py b/contrib/oe-stylize.py
index 07ed4f6..712557d 100755
--- a/contrib/oe-stylize.py
+++ b/contrib/oe-stylize.py
@@ -306,10 +306,10 @@ def follow_rule(i, line):
# if the line still does not respect the rule
if not rules[i][0](line):
# this is a rule disgression
- print "## Disgression: ", rules[i][2], " in:", oldline
+ print ("## Disgression: ", rules[i][2], " in:", oldline)
else:
# just remind user about his/her errors
- print "## Reminder: ", rules[i][2], " in :", oldline
+ print ("## Reminder: ", rules[i][2], " in :", oldline)
return line
@@ -363,7 +363,7 @@ if __name__ == "__main__":
commentBloc.append(line)
continue
- if seen_vars.has_key(var):
+ if var in seen_vars:
for c in commentBloc: seen_vars[var].append(c)
commentBloc = []
seen_vars[var].append(line)
@@ -381,7 +381,7 @@ if __name__ == "__main__":
line = follow_rule(5, line)
if var == "":
if not in_routine:
- print "## Warning: unknown variable/routine \"%s\"" % originalLine.rstrip('\n')
+ print ("## Warning: unknown variable/routine \"%s\"" % originalLine.rstrip('\n'))
var = 'others'
for c in commentBloc: seen_vars[var].append(c)
commentBloc = []
@@ -402,5 +402,5 @@ if __name__ == "__main__":
for l in seen_vars[k]:
olines.append(l)
previourVarPrefix = k.split('_')[0]=='' and "unknown" or k.split('_')[0]
- for line in olines: print line
+ for line in olines: print(line)
More information about the Openembedded-commits
mailing list