]> sigrok.org Git - libsigrok.git/commitdiff
bindings: Filter out various pygccxml noise.
authorBert Vermeulen <redacted>
Sat, 19 Jul 2014 17:48:01 +0000 (19:48 +0200)
committerBert Vermeulen <redacted>
Sat, 19 Jul 2014 17:48:01 +0000 (19:48 +0200)
bindings/cxx/enums.py

index f5f6e58d91c5367032eb1249e1a5ea839ce21fd5..46a1472448d28734fbb0951bd3d5523a79b74405 100644 (file)
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 ##
 
+import logging, warnings
 from pygccxml import parser, declarations
 from collections import OrderedDict
 import sys, os, re
 
+class crapfilter(logging.Filter):
+    def filter(self, record):
+        if record.msg.find('GCCXML version') > -1:
+            return 0
+        return 1
+logger = logging.getLogger('pygccxml.cxx_parser').addFilter(crapfilter())
+warnings.filterwarnings('ignore', message="unable to find out array size from expression")
+
 # Get directory this script is in.
 dirname = os.path.dirname(os.path.realpath(__file__))