1 |
commit: 86f443210464a83721be581cc00cfe08dc5632bd |
2 |
Author: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 26 22:10:42 2015 +0000 |
4 |
Commit: Gilles Dartiguelongue <eva <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jun 26 22:14:43 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gnome.git/commit/?id=86f44321 |
7 |
|
8 |
scripts/gen_archlist: simplify logic of file parsing |
9 |
|
10 |
scripts/gen_archlist.py | 11 +++++++---- |
11 |
1 file changed, 7 insertions(+), 4 deletions(-) |
12 |
|
13 |
diff --git a/scripts/gen_archlist.py b/scripts/gen_archlist.py |
14 |
index 1633dfa..21a196f 100755 |
15 |
--- a/scripts/gen_archlist.py |
16 |
+++ b/scripts/gen_archlist.py |
17 |
@@ -486,11 +486,14 @@ def main(): |
18 |
}) |
19 |
|
20 |
ALL_CPV_KWS = [] |
21 |
- for i in open(args.file).readlines(): |
22 |
- cp = i[:-1] |
23 |
- if cp.startswith('#') or cp.isspace() or not cp: |
24 |
+ for line in open(args.file).readlines(): |
25 |
+ cp = line.strip() |
26 |
+ |
27 |
+ # Filter useless lines |
28 |
+ if not cp or cp.startswith('#'): |
29 |
continue |
30 |
- if cp.find('#') is not -1: |
31 |
+ |
32 |
+ if '#' in cp: |
33 |
raise Exception('Inline comments are not supported') |
34 |
|
35 |
# Convert line to CPV(s) |