diff options
author | Chris Johns <chrisj@rtems.org> | 2023-04-14 13:43:44 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-04-14 13:43:44 +1000 |
commit | 2c15b90de5c369aa78cd2252a50bba677e9b13f3 (patch) | |
tree | 2f93cb3d1665351b1042a561139976c4d941f872 /pkgconfig.py | |
parent | Add version and git support for apps to use (diff) | |
download | rtems_waf-2c15b90de5c369aa78cd2252a50bba677e9b13f3.tar.bz2 |
Format with YAPF
Diffstat (limited to 'pkgconfig.py')
-rw-r--r-- | pkgconfig.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pkgconfig.py b/pkgconfig.py index 382f4dc..673633a 100644 --- a/pkgconfig.py +++ b/pkgconfig.py @@ -1,5 +1,5 @@ # Copyright 2013 Chris Johns (chrisj@rtems.org) -# +# # This file's license is 2-clause BSD as in this distribution's LICENSE.2 file. # @@ -12,6 +12,7 @@ # import re + class error(Exception): def __init__(self, msg): self.msg = msg @@ -19,8 +20,9 @@ class error(Exception): def __str__(self): return self.msg + class package: - def __init__(self, file = None): + def __init__(self, file=None): self.defines = {} self.fields = {} if file: @@ -57,7 +59,8 @@ class package: rhs = l[d + 1:] if tm: - print('define: ' + str(define) + ', lhs: ' + lhs + ', ' + rhs) + print('define: ' + str(define) + ', lhs: ' + lhs + + ', ' + rhs) if define: self.defines[lhs] = rhs @@ -65,7 +68,7 @@ class package: self.fields[lhs] = rhs def get(self, label): - if label.lower() not in self.fields: + if label.lower() not in self.fields: raise error('Label not found: ' + label) mre = re.compile('\$\{[^\}]+\}') s = self.fields[label.lower()] |