gobject-introspection r1034 - trunk/giscanner



Author: walters
Date: Wed Jan 14 17:39:36 2009
New Revision: 1034
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=1034&view=rev

Log:
Add generated file warning comment

We don't want people manually editing .gir files.

Modified:
   trunk/giscanner/girwriter.py
   trunk/giscanner/xmlwriter.py

Modified: trunk/giscanner/girwriter.py
==============================================================================
--- trunk/giscanner/girwriter.py	(original)
+++ trunk/giscanner/girwriter.py	Wed Jan 14 17:39:36 2009
@@ -35,6 +35,8 @@
 
     def __init__(self, namespace, shlibs, includes):
         super(GIRWriter, self).__init__()
+        self.write_comment('''This file was automatically generated from C sources - DO NOT EDIT!
+     To affect the contents of this file, edit the original C definitions, and/or use gtk-doc annotations. ''')
         self._write_repository(namespace, shlibs, includes)
 
     def _write_repository(self, namespace, shlibs, includes=set()):

Modified: trunk/giscanner/xmlwriter.py
==============================================================================
--- trunk/giscanner/xmlwriter.py	(original)
+++ trunk/giscanner/xmlwriter.py	Wed Jan 14 17:39:36 2009
@@ -101,6 +101,9 @@
     def write_line(self, line=''):
         self._data.write('%s%s\n' % (self._indent_char * self._indent, line))
 
+    def write_comment(self, text):
+        self.write_line('<!-- %s -->' % (text, ))
+
     def write_tag(self, tag_name, attributes, data=None):
         if attributes is None:
             attributes = []



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