gobject-introspection r341 - in trunk: . giscanner tools



Author: johan
Date: Sat Aug  9 13:07:11 2008
New Revision: 341
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=341&view=rev

Log:
2008-08-09  Johan Dahlin  <johan gnome org>

    * giscanner/__init__.py:
    * giscanner/ast.py:
    * giscanner/cgobject.py:
    * giscanner/gidlparser.py:
    * giscanner/gidlwriter.py:
    * giscanner/girparser.py:
    * giscanner/girwriter.py:
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    * giscanner/odict.py:
    * giscanner/sourcescanner.py:
    * giscanner/transformer.py:
    * giscanner/utils.py:
    * giscanner/xmlwriter.py:
    * tools/g-ir-scanner:

    PEP8ify



Modified:
   trunk/ChangeLog
   trunk/giscanner/__init__.py
   trunk/giscanner/ast.py
   trunk/giscanner/cgobject.py
   trunk/giscanner/gidlparser.py
   trunk/giscanner/gidlwriter.py
   trunk/giscanner/girparser.py
   trunk/giscanner/girwriter.py
   trunk/giscanner/glibast.py
   trunk/giscanner/glibtransformer.py
   trunk/giscanner/odict.py
   trunk/giscanner/sourcescanner.py
   trunk/giscanner/transformer.py
   trunk/giscanner/utils.py
   trunk/giscanner/xmlwriter.py
   trunk/tools/g-ir-scanner

Modified: trunk/giscanner/__init__.py
==============================================================================
--- trunk/giscanner/__init__.py	(original)
+++ trunk/giscanner/__init__.py	Sat Aug  9 13:07:11 2008
@@ -17,4 +17,3 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 # 02110-1301, USA.
 #
-

Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py	(original)
+++ trunk/giscanner/ast.py	Sat Aug  9 13:07:11 2008
@@ -31,35 +31,35 @@
 ##
 
 # Basic types
-TYPE_INT8     = 'int8'
-TYPE_UINT8    = 'uint8'
-TYPE_INT16    = 'int16'
-TYPE_UINT16   = 'uint16'
-TYPE_INT32    = 'int32'
-TYPE_UINT32   = 'uint32'
-TYPE_INT64    = 'int64'
-TYPE_UINT64   = 'uint64'
-TYPE_LONG     = 'long'
-TYPE_ULONG    = 'ulong'
+TYPE_INT8 = 'int8'
+TYPE_UINT8 = 'uint8'
+TYPE_INT16 = 'int16'
+TYPE_UINT16 = 'uint16'
+TYPE_INT32 = 'int32'
+TYPE_UINT32 = 'uint32'
+TYPE_INT64 = 'int64'
+TYPE_UINT64 = 'uint64'
+TYPE_LONG = 'long'
+TYPE_ULONG = 'ulong'
 
 # Floating-point
-TYPE_FLOAT    = 'float'
-TYPE_DOUBLE   = 'double'
+TYPE_FLOAT = 'float'
+TYPE_DOUBLE = 'double'
 
 # Higher-level data types
-TYPE_NONE     = 'none'
-TYPE_ANY      = 'any'      # CORBA Any/Variant/GValue, holds anything.
-TYPE_BOOLEAN  = 'boolean'  # True/False
-TYPE_STRING   = 'string'   # Sequence of characters
+TYPE_NONE = 'none'
+TYPE_ANY = 'any'           # CORBA Any/Variant/GValue, holds anything.
+TYPE_BOOLEAN = 'boolean'   # True/False
+TYPE_STRING = 'string'     # Sequence of characters
 TYPE_SEQUENCE = 'sequence' # Sequence of something
-TYPE_CHAR     = 'char'     # Character
-TYPE_UCHAR    = 'uchar'    # Unsigned Character
-TYPE_SIZE     = 'size'     # Size type (memory, buffer etc)
-TYPE_SSIZE    = 'ssize'
+TYPE_CHAR = 'char'         # Character
+TYPE_UCHAR = 'uchar'       # Unsigned Character
+TYPE_SIZE = 'size'         # Size type (memory, buffer etc)
+TYPE_SSIZE = 'ssize'
 
 # Wide/Unicode
-TYPE_UCHAR    = 'uchar'
-TYPE_USTRING  = 'ustring'
+TYPE_UCHAR = 'uchar'
+TYPE_USTRING = 'ustring'
 
 # Domain specific, but practically useful
 TYPE_FILENAME = 'filename'
@@ -106,6 +106,7 @@
 
 
 class Namespace(Node):
+
     def __init__(self, name):
         Node.__init__(self, name)
         self.nodes = []
@@ -114,7 +115,9 @@
         return '%s(%r, %r)' % (self.__class__.__name__, self.name,
                                self.nodes)
 
+
 class Function(Node):
+
     def __init__(self, name, retval, parameters, symbol):
         Node.__init__(self, name)
         self.retval = retval
@@ -132,12 +135,14 @@
 
 
 class Type(Node):
+
     def __init__(self, name, ctype=None):
         Node.__init__(self, name)
         self.ctype = ctype
 
 
 class Parameter(Node):
+
     def __init__(self, name, typenode):
         Node.__init__(self, name)
         self.type = typenode
@@ -150,6 +155,7 @@
 
 
 class Enum(Node):
+
     def __init__(self, name, symbol, members):
         Node.__init__(self, name)
         self.symbol = symbol
@@ -160,6 +166,7 @@
 
 
 class Member(Node):
+
     def __init__(self, name, value, symbol):
         Node.__init__(self, name)
         self.value = value
@@ -170,6 +177,7 @@
 
 
 class Struct(Node):
+
     def __init__(self, name, symbol):
         Node.__init__(self, name)
         self.fields = []
@@ -177,6 +185,7 @@
 
 
 class Field(Node):
+
     def __init__(self, name, typenode, symbol):
         Node.__init__(self, name)
         self.type = typenode
@@ -187,16 +196,18 @@
 
 
 class Return(Node):
+
     def __init__(self, rtype):
         Node.__init__(self)
         self.type = rtype
         self.transfer = False
 
     def __repr__(self):
-        return 'Return(%r)' % (self.type,)
+        return 'Return(%r)' % (self.type, )
 
 
 class Class(Node):
+
     def __init__(self, name, parent):
         Node.__init__(self, name)
         self.ctype = name
@@ -213,6 +224,7 @@
 
 
 class Interface(Node):
+
     def __init__(self, name):
         Node.__init__(self, name)
         self.methods = []
@@ -226,6 +238,7 @@
 
 
 class Constant(Node):
+
     def __init__(self, name, type_name, value):
         Node.__init__(self, name)
         self.type = Type(type_name)
@@ -237,6 +250,7 @@
 
 
 class Property(Node):
+
     def __init__(self, name, type_name, ctype=None):
         Node.__init__(self, name)
         self.type = Type(type_name, ctype)
@@ -248,7 +262,10 @@
 
 
 # FIXME: Inherit from Function
+
+
 class Callback(Node):
+
     def __init__(self, name, retval, parameters):
         Node.__init__(self, name)
         self.retval = retval
@@ -261,8 +278,8 @@
 
 class Sequence(Type):
     # Subclass, because a Sequence is a kind of Type
+
     def __init__(self, name, ctype, element_type):
         Type.__init__(self, name, ctype)
         self.element_type = element_type
         self.transfer = False
-

Modified: trunk/giscanner/cgobject.py
==============================================================================
--- trunk/giscanner/cgobject.py	(original)
+++ trunk/giscanner/cgobject.py	Sat Aug  9 13:07:11 2008
@@ -51,6 +51,7 @@
 
 # Structs
 
+
 class GTypeClass(ctypes.Structure):
     _fields_ = [('g_type', GType)]
 
@@ -72,7 +73,7 @@
 
 
 class GEnumClass(ctypes.Structure):
-    _fields_ = [('g_type_class',  GTypeClass),
+    _fields_ = [('g_type_class', GTypeClass),
                 ('minimum', ctypes.c_int),
                 ('maximum', ctypes.c_int),
                 ('n_values', ctypes.c_uint),
@@ -137,20 +138,28 @@
 # Functions
 
 _gobj.g_type_name.restype = ctypes.c_char_p
+
+
 def type_name(type_id):
     return _gobj.g_type_name(type_id)
 
 _gobj.g_type_from_name.argtypes = [ctypes.c_char_p]
+
+
 def type_from_name(name):
     return _gobj.g_type_from_name(name)
 
+
 def type_fundamental(type_id):
     return _gobj.g_type_fundamental(type_id)
 
+
 def type_parent(type_id):
     return _gobj.g_type_parent(type_id)
 
 _gobj.g_type_class_ref.restype = ctypes.POINTER(GTypeClass)
+
+
 def type_class_ref(type_id):
     fundamental_type = type_fundamental(type_id)
     if fundamental_type == TYPE_INVALID:
@@ -166,6 +175,8 @@
 
 _gobj.g_object_class_list_properties.restype = ctypes.POINTER(
     ctypes.POINTER(GParamSpec))
+
+
 def object_class_list_properties(type_id):
     klass = _gobj.g_type_class_ref(type_id)
     n = ctypes.c_uint()
@@ -175,6 +186,8 @@
 
 _gobj.g_object_interface_list_properties.restype = ctypes.POINTER(
     ctypes.POINTER(GParamSpec))
+
+
 def object_interface_list_properties(type_id):
     iface = _gobj.g_type_default_interface_ref(type_id)
     n = ctypes.c_uint()
@@ -183,6 +196,8 @@
         yield ctypes.cast(pspecs[i], ctypes.POINTER(GParamSpec)).contents
 
 _gobj.g_type_interfaces.restype = ctypes.POINTER(ctypes.c_int)
+
+
 def type_interfaces(type_id):
     n = ctypes.c_uint()
     type_ids = _gobj.g_type_interfaces(type_id, ctypes.byref(n))
@@ -190,6 +205,8 @@
         yield type_ids[i]
 
 _gobj.g_type_interface_prerequisites.restype = ctypes.POINTER(ctypes.c_int)
+
+
 def type_interface_prerequisites(type_id):
     n = ctypes.c_uint()
     type_ids = _gobj.g_type_interface_prerequisites(type_id, ctypes.byref(n))
@@ -197,6 +214,8 @@
         yield type_ids[i]
 
 _gobj.g_signal_list_ids.restype = ctypes.POINTER(ctypes.c_int)
+
+
 def signal_list(type_id):
     n = ctypes.c_uint()
     signal_ids = _gobj.g_signal_list_ids(type_id, ctypes.byref(n))

Modified: trunk/giscanner/gidlparser.py
==============================================================================
--- trunk/giscanner/gidlparser.py	(original)
+++ trunk/giscanner/gidlparser.py	Sat Aug  9 13:07:11 2008
@@ -24,6 +24,7 @@
 
 
 class GIDLParser(object):
+
     def __init__(self, filename):
         self._nodes = []
         self._namespace_name = None
@@ -39,7 +40,7 @@
             if child.tag == 'object':
                 self._parse_object(child)
             else:
-                print 'PARSER: Unhandled %s' % (child.tag,)
+                print 'PARSER: Unhandled %s' % (child.tag, )
 
     def _parse_object(self, node):
         gobj = GLibObject(node.attrib['name'],

Modified: trunk/giscanner/gidlwriter.py
==============================================================================
--- trunk/giscanner/gidlwriter.py	(original)
+++ trunk/giscanner/gidlwriter.py	Sat Aug  9 13:07:11 2008
@@ -27,6 +27,7 @@
 
 
 class GIDLWriter(XMLWriter):
+
     def __init__(self, namespace):
         super(GIDLWriter, self).__init__()
         self._write_api(namespace)

Modified: trunk/giscanner/girparser.py
==============================================================================
--- trunk/giscanner/girparser.py	(original)
+++ trunk/giscanner/girparser.py	Sat Aug  9 13:07:11 2008
@@ -25,14 +25,17 @@
 CORE_NS = "http://www.gtk.org/introspection/core/1.0";
 GLIB_NS = "http://www.gtk.org/introspection/glib/1.0";
 
+
 def _corens(tag):
     return '{%s}%s' % (CORE_NS, tag)
 
+
 def _glibns(tag):
     return '{%s}%s' % (GLIB_NS, tag)
 
 
 class GIRParser(object):
+
     def __init__(self, filename):
         self._nodes = []
         self._namespace_name = None
@@ -58,7 +61,7 @@
                                ]:
                 continue
             else:
-                print 'PARSER: Unhandled %s' % (child.tag,)
+                print 'PARSER: Unhandled %s' % (child.tag, )
 
     def _parse_object(self, node):
         gobj = GLibObject(node.attrib['name'],

Modified: trunk/giscanner/girwriter.py
==============================================================================
--- trunk/giscanner/girwriter.py	(original)
+++ trunk/giscanner/girwriter.py	Sat Aug  9 13:07:11 2008
@@ -28,6 +28,7 @@
 
 
 class GIRWriter(XMLWriter):
+
     def __init__(self, namespace):
         super(GIRWriter, self).__init__()
         self._write_repository(namespace)
@@ -229,4 +230,3 @@
         with self.tagcontext('glib:signal', attrs):
             self._write_return_type(signal.retval)
             self._write_parameters(signal.parameters)
-

Modified: trunk/giscanner/glibast.py
==============================================================================
--- trunk/giscanner/glibast.py	(original)
+++ trunk/giscanner/glibast.py	Sat Aug  9 13:07:11 2008
@@ -46,7 +46,9 @@
 type_names['gsize'] = TYPE_SIZE
 type_names['gssize'] = TYPE_SSIZE
 
+
 class GLibEnum(Enum):
+
     def __init__(self, name, type_name, members, get_type):
         Enum.__init__(self, name, type_name, members)
         self.ctype = type_name
@@ -66,12 +68,14 @@
 
 
 class GLibEnumMember(Member):
+
     def __init__(self, name, value, symbol, nick):
         Member.__init__(self, name, value, symbol)
         self.nick = nick
 
 
 class GLibObject(Class):
+
     def __init__(self, name, parent, type_name, get_type):
         Class.__init__(self, name, parent)
         self.ctype = type_name
@@ -79,7 +83,9 @@
         self.get_type = get_type
         self.signals = []
 
+
 class GLibBoxed(Struct):
+
     def __init__(self, name, type_name, get_type):
         Struct.__init__(self, name, get_type)
         self.ctype = name
@@ -91,6 +97,7 @@
 
 
 class GLibInterface(Interface):
+
     def __init__(self, name, type_name, get_type):
         Interface.__init__(self, name)
         self.ctype = type_name
@@ -104,6 +111,7 @@
 
 
 class GLibSignal(Node):
+
     def __init__(self, name, retval):
         Node.__init__(self, name)
         self.retval = retval

Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py	(original)
+++ trunk/giscanner/glibtransformer.py	Sat Aug  9 13:07:11 2008
@@ -32,6 +32,7 @@
 
 
 class GLibTransformer(object):
+
     def __init__(self, transformer):
         self._transformer = transformer
         self._namespace_name = None
@@ -245,7 +246,7 @@
         elif fundamental_type_id == cgobject.TYPE_BOXED:
             self._introspect_boxed(type_id, symbol)
         else:
-            print 'unhandled GType: %s' % (cgobject.type_name(type_id),)
+            print 'unhandled GType: %s' % (cgobject.type_name(type_id), )
 
     def _introspect_enum(self, ftype_id, type_id, symbol):
         type_class = cgobject.type_class_ref(type_id)
@@ -332,7 +333,7 @@
                 if i == 0:
                     name = 'object'
                 else:
-                    name = 'p%s' % (i-1,)
+                    name = 'p%s' % (i-1, )
                 ptype = self._create_type(parameter)
                 param = Parameter(name, ptype)
                 signal.parameters.append(param)

Modified: trunk/giscanner/odict.py
==============================================================================
--- trunk/giscanner/odict.py	(original)
+++ trunk/giscanner/odict.py	Sat Aug  9 13:07:11 2008
@@ -24,6 +24,7 @@
 
 
 class odict(DictMixin):
+
     def __init__(self):
         self._items = {}
         self._keys = []

Modified: trunk/giscanner/sourcescanner.py
==============================================================================
--- trunk/giscanner/sourcescanner.py	(original)
+++ trunk/giscanner/sourcescanner.py	Sat Aug  9 13:07:11 2008
@@ -67,6 +67,7 @@
  UNARY_BITWISE_COMPLEMENT,
  UNARY_LOGICAL_NEGATION) = range(6)
 
+
 def symbol_type_name(symbol_type):
     return {
         CSYMBOL_TYPE_INVALID: 'invalid',
@@ -80,6 +81,7 @@
         CSYMBOL_TYPE_MEMBER: 'member',
         }.get(symbol_type)
 
+
 def ctype_name(ctype):
     return {
         CTYPE_INVALID: 'invalid',
@@ -91,12 +93,13 @@
         CTYPE_ENUM: 'enum',
         CTYPE_POINTER: 'pointer',
         CTYPE_ARRAY: 'array',
-        CTYPE_FUNCTION: 'function'
+        CTYPE_FUNCTION: 'function',
         }.get(ctype)
 
 
 class SourceType(object):
     __members__ = ['type', 'base_type', 'name', 'child_list']
+
     def __init__(self, scanner, stype):
         self._scanner = scanner
         self._stype = stype
@@ -106,7 +109,7 @@
             self.__class__.__name__,
             ctype_name(self.type),
             self.name)
-    
+
     @property
     def type(self):
         return self._stype.type
@@ -130,6 +133,7 @@
 
 class SourceSymbol(object):
     __members__ = ['const_int', 'ident', 'type', 'base_type']
+
     def __init__(self, scanner, symbol):
         self._scanner = scanner
         self._symbol = symbol
@@ -165,10 +169,11 @@
 
 
 class SourceScanner(object):
+
     def __init__(self):
         self._scanner = _giscanner.SourceScanner()
         self._filenames = []
-        self._cpp_options = []    
+        self._cpp_options = []
 
     # Public API
 
@@ -216,7 +221,7 @@
     def _parse(self, filenames):
         if not filenames:
             return
-        
+
         cpp_args = [
             'cpp',
             '-C',
@@ -228,10 +233,10 @@
         proc = subprocess.Popen(cpp_args,
                                 stdin=subprocess.PIPE,
                                 stdout=subprocess.PIPE)
-                                
+
         for filename in filenames:
             filename = os.path.abspath(filename)
-            proc.stdin.write('#include <%s>\n' % (filename,))
+            proc.stdin.write('#include <%s>\n' % (filename, ))
         proc.stdin.close()
 
         tmp = tempfile.mktemp()

Modified: trunk/giscanner/transformer.py
==============================================================================
--- trunk/giscanner/transformer.py	(original)
+++ trunk/giscanner/transformer.py	Sat Aug  9 13:07:11 2008
@@ -32,6 +32,7 @@
 
 
 class Transformer(object):
+
     def __init__(self, generator, namespace_name):
         self.generator = generator
         self._namespace = Namespace(namespace_name)
@@ -122,7 +123,7 @@
             pass
         else:
             raise NotImplementedError(
-                'Transformer: unhandled symbol: %r' % (symbol,))
+                'Transformer: unhandled symbol: %r' % (symbol, ))
 
     def _create_enum(self, symbol):
         members = []
@@ -141,7 +142,8 @@
 
     def _create_function(self, symbol):
         directives = symbol.directives()
-        parameters = list(self._create_parameters(symbol.base_type, directives))
+        parameters = list(self._create_parameters(
+            symbol.base_type, directives))
         return_ = self._create_return(symbol.base_type.base_type,
                                       directives.get('return', []))
         name = self._remove_prefix(symbol.ident)
@@ -163,7 +165,7 @@
             value = self._create_source_type(source_type.base_type) + '*'
         else:
             print 'TRANSFORMER: Unhandled source type %r' % (
-                source_type,)
+                source_type, )
             value = '???'
         return value
 
@@ -183,7 +185,7 @@
             ftype = self._create_type(symbol.base_type)
             node = Field(symbol.ident, ftype, symbol.ident)
         return node
-    
+
     def _create_typedef(self, symbol):
         ctype = symbol.base_type.type
         if (ctype == CTYPE_POINTER and
@@ -225,7 +227,7 @@
                 param.allow_none = True
             else:
                 print 'Unhandled parameter annotation option: %s' % (
-                    option,)
+                    option, )
         return param
 
     def _create_return(self, source_type, options=None):
@@ -247,7 +249,7 @@
                 return_.type = seq
             else:
                 print 'Unhandled parameter annotation option: %s' % (
-                    option,)
+                    option, )
         return return_
 
     def _create_typedef_struct(self, symbol):
@@ -294,4 +296,3 @@
         type_name = ptype.name
         ptype.name = self._resolve_type_name(type_name)
         return ptype
-

Modified: trunk/giscanner/utils.py
==============================================================================
--- trunk/giscanner/utils.py	(original)
+++ trunk/giscanner/utils.py	Sat Aug  9 13:07:11 2008
@@ -26,6 +26,7 @@
 _upperstr_pat2 = re.compile(r'([A-Z][A-Z])([A-Z][0-9a-z])')
 _upperstr_pat3 = re.compile(r'^([A-Z])([A-Z])')
 
+
 def to_underscores(name):
     """Converts a typename to the equivalent underscores name.
     This is used to form the type conversion macros and enum/flag
@@ -37,6 +38,7 @@
 
 _libtool_pat = re.compile("dlname='([A-z0-9\.\-\+]+)'\n")
 
+
 def resolve_libtool(libname):
     data = open(libname).read()
     filename = _libtool_pat.search(data).groups()[0]
@@ -44,10 +46,10 @@
                            '.libs', filename)
     return libname
 
+
 def strip_common_prefix(first, second):
     first_underscore = to_underscores(first)
     for i, c in enumerate(first_underscore.upper()):
         if c != second[i]:
             break
     return second[i:]
-    

Modified: trunk/giscanner/xmlwriter.py
==============================================================================
--- trunk/giscanner/xmlwriter.py	(original)
+++ trunk/giscanner/xmlwriter.py	Sat Aug  9 13:07:11 2008
@@ -24,6 +24,7 @@
 
 
 class XMLWriter(object):
+
     def __init__(self):
         self._data = StringIO()
         self._tag_stack = []
@@ -40,7 +41,7 @@
         for attr, value in attributes:
             if value is None:
                 raise ValueError(
-                    "value for attribute %r cannot be None" % (attr,))
+                    "value for attribute %r cannot be None" % (attr, ))
             attr_length += 2 + len(attr) + len(quoteattr(value))
         return attr_length + indent + self._indent
 
@@ -58,7 +59,7 @@
                 attr_value += '\n%s' % (self._indent_char * indent_len)
             if value is None:
                 raise ValueError(
-                    "value for attribute %r cannot be None" % (attr,))
+                    "value for attribute %r cannot be None" % (attr, ))
             attr_value += ' %s=%s' % (attr, quoteattr(value))
             if first:
                 first = False
@@ -70,7 +71,7 @@
         self.write_line('<%s%s>' % (tag_name, attrs))
 
     def _close_tag(self, tag_name):
-        self.write_line('</%s>' % (tag_name,))
+        self.write_line('</%s>' % (tag_name, ))
 
     # Public API
 
@@ -83,7 +84,7 @@
     def write_tag(self, tag_name, attributes, data=None):
         if attributes is None:
             attributes = []
-        prefix = '<%s' % (tag_name,)
+        prefix = '<%s' % (tag_name, )
         if data is not None:
             suffix = '>%s</%s>' % (data, tag_name)
         else:
@@ -122,7 +123,7 @@
                 ('value', '7'),
                 ('c:identifier', 'GTK_ANCHOR_WEST'),
                 ('glib:nick', 'west')])
-    
+
     w.pop_tag()
     w.pop_tag()
     w.pop_tag()

Modified: trunk/tools/g-ir-scanner
==============================================================================
--- trunk/tools/g-ir-scanner	(original)
+++ trunk/tools/g-ir-scanner	Sat Aug  9 13:07:11 2008
@@ -82,8 +82,10 @@
 
     return parser
 
+
 def _error(msg):
-    raise SystemExit('ERROR: %s' % (msg,))
+    raise SystemExit('ERROR: %s' % (msg, ))
+
 
 def main(args):
     parser = _get_option_parser()
@@ -100,10 +102,10 @@
     elif options.format == 'gidl':
         from giscanner.gidlwriter import GIDLWriter as Writer
     else:
-        _error("Unknown format: %s" % (options.format,))
+        _error("Unknown format: %s" % (options.format, ))
 
     for package in options.packages:
-        output = commands.getoutput('pkg-config --cflags %s' % (package,))
+        output = commands.getoutput('pkg-config --cflags %s' % (package, ))
         pkg_options, unused = parser.parse_args(output.split())
         options.cpp_includes.extend(pkg_options.cpp_includes)
         options.cpp_defines.extend(pkg_options.cpp_defines)
@@ -114,7 +116,7 @@
         if (arg.endswith('.c') or
             arg.endswith('.h')):
             if not os.path.exists(arg):
-                _error('%s: no such a file or directory' % (arg,))
+                _error('%s: no such a file or directory' % (arg, ))
             filenames.append(arg)
 
     # Run the preprocessor, tokenize and construct simple



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