gobject-introspection r366 - in trunk: . giscanner tests



Author: johan
Date: Thu Aug 14 09:28:38 2008
New Revision: 366
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=366&view=rev

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

    * giscanner/ast.py:
    * giscanner/girparser.py:
    * giscanner/glibtransformer.py:
    * tests/Makefile.am:
    Run pep8.py in make check, fix old errors.



Modified:
   trunk/ChangeLog
   trunk/giscanner/ast.py
   trunk/giscanner/girparser.py
   trunk/giscanner/glibtransformer.py
   trunk/tests/Makefile.am

Modified: trunk/giscanner/ast.py
==============================================================================
--- trunk/giscanner/ast.py	(original)
+++ trunk/giscanner/ast.py	Thu Aug 14 09:28:38 2008
@@ -143,7 +143,7 @@
 
 class Alias(Node):
 
-    def __init__(self, name, target,ctype=None):
+    def __init__(self, name, target, ctype=None):
         Node.__init__(self, name)
         self.target = target
         self.ctype = ctype

Modified: trunk/giscanner/girparser.py
==============================================================================
--- trunk/giscanner/girparser.py	(original)
+++ trunk/giscanner/girparser.py	Thu Aug 14 09:28:38 2008
@@ -41,9 +41,11 @@
 def _glibns(tag):
     return '{%s}%s' % (GLIB_NS, tag)
 
+
 def _cns(tag):
     return '{%s}%s' % (C_NS, tag)
 
+
 class GIRParser(object):
 
     def __init__(self, filename):
@@ -53,11 +55,9 @@
         tree = parse(filename)
         self._parse_api(tree.getroot())
 
-
     def _add_node(self, node):
         self._nodes.append(node)
 
-
     def _parse_api(self, root):
         assert root.tag == _corens('repository')
         ns = root.find(_corens('namespace'))
@@ -78,7 +78,9 @@
                 self._parse_functions_props(child, c)
                 self._add_node(c)
             if child.tag == _corens('interface'):
-                c = GLibInterface(child.attrib['name'], child.attrib[_glibns('type-name')], child.attrib[_glibns('get-type')])
+                c = GLibInterface(child.attrib['name'],
+                                  child.attrib[_glibns('type-name')],
+                                  child.attrib[_glibns('get-type')])
                 self._parse_functions_props(child, c)
                 self._add_node(c)
             if child.tag == _corens('record'):
@@ -91,11 +93,9 @@
                              ]:
                 pass
 
-
     def _parse_alias(self, child):
         return Alias(child.attrib['name'], child.attrib['target'])
 
-
     def _parse_functions_props(self, child, obj):
         for meth in child.findall(_corens('method')):
             obj.methods.append(self._parse_function(meth, Function))
@@ -104,7 +104,6 @@
         for cb in child.findall(_corens('callback')):
             obj.fields.append(self._parse_function(cb, Callback))
 
-
     def _parse_function(self, child, klass):
         retval = Return(self._parse_type(child.find(_corens('return-value'))))
         params = []
@@ -123,18 +122,14 @@
             args.append(ident)
         return klass(*args)
 
-
     def _parse_type(self, node):
         typenode = node.find(_corens('type'))
         if node is None:
             raise ValueError("failed to find type")
         return Type(typenode.attrib['name'], typenode.attrib[_cns('type')])
 
-
     def get_namespace_name(self):
         return self._namespace_name
 
-
     def get_nodes(self):
         return self._nodes
-

Modified: trunk/giscanner/glibtransformer.py
==============================================================================
--- trunk/giscanner/glibtransformer.py	(original)
+++ trunk/giscanner/glibtransformer.py	Thu Aug 14 09:28:38 2008
@@ -328,10 +328,11 @@
         type_name = 'G' + node.name
         if type_name == 'GObject':
             parent_type_name = None
-            symbol = None
+            symbol = 'intern'
         else:
             type_id = cgobject.type_from_name(type_name)
-            parent_type_name = cgobject.type_name(cgobject.type_parent(type_id))
+            parent_type_name = cgobject.type_name(
+                cgobject.type_parent(type_id))
             symbol = to_underscores(type_name).lower() + '_get_type'
         node = GLibObject(node.name, parent_type_name, type_name, symbol)
         type_id = cgobject.TYPE_OBJECT

Modified: trunk/tests/Makefile.am
==============================================================================
--- trunk/tests/Makefile.am	(original)
+++ trunk/tests/Makefile.am	Thu Aug 14 09:28:38 2008
@@ -18,3 +18,6 @@
 	xref2.gir
 
 TESTS = #roundtrips.sh
+
+check-local:
+	find $(top_srcdir)/giscanner -name \*.py | sort | uniq | xargs echo $(PYTHON) $(top_srcdir)/misc/pep8.py --repeat



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