[gobject-introspection] [scannermain] Create a new option parser



commit 95883d357b9205094ea285ffb64b508e6317a823
Author: Johan Dahlin <johan gnome org>
Date:   Thu Sep 2 12:21:38 2010 -0300

    [scannermain] Create a new option parser
    
    Create a new option parser when parsing pkg-config output

 giscanner/scannermain.py |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index bf2af39..d2bd876 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -183,7 +183,7 @@ def process_options(output, allowed_flags):
             yield option
             break
 
-def process_packages(parser, options, packages):
+def process_packages(options, packages):
     args = ['pkg-config', '--cflags']
     args.extend(packages)
     output = subprocess.Popen(args,
@@ -196,6 +196,7 @@ def process_packages(parser, options, packages):
     # so we explicitly filter to only the ones we need.
     options_whitelist = ['-I', '-D', '-U', '-l', '-L']
     filtered_output = list(process_options(output, options_whitelist))
+    parser = _get_option_parser()
     pkg_options, unused = parser.parse_args(filtered_output)
     options.cpp_includes.extend(pkg_options.cpp_includes)
     options.cpp_defines.extend(pkg_options.cpp_defines)
@@ -283,7 +284,7 @@ def scanner_main(args):
 
     packages = set(options.packages)
     packages.update(transformer.get_pkgconfig_packages())
-    exit_code = process_packages(parser, options, packages)
+    exit_code = process_packages(options, packages)
     if exit_code:
         return exit_code
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]