[glib] gdbus-codegen: Strip @since parameters before comparison



commit 097f70828fa2b2b1b903c2969ce756e27750675c
Author: Philip Withnall <philip withnall collabora co uk>
Date:   Thu Aug 25 10:25:49 2016 +0100

    gdbus-codegen: Strip @since parameters before comparison
    
    People might put more extraneous whitespace in a @since line in a
    documentation comment, which should not affect the ordering of
    methods/signals/etc. in the generated output.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=770372

 gio/gdbus-2.0/codegen/parser.py |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/gio/gdbus-2.0/codegen/parser.py b/gio/gdbus-2.0/codegen/parser.py
index 178d114..90cebd9 100644
--- a/gio/gdbus-2.0/codegen/parser.py
+++ b/gio/gdbus-2.0/codegen/parser.py
@@ -156,7 +156,8 @@ class DBusXMLParser:
                     short_description = self.doc_comment_params['short_description']
                     self._cur_object.doc_string_brief = short_description
                 if 'since' in self.doc_comment_params:
-                    self._cur_object.since = self.doc_comment_params['since']
+                    self._cur_object.since = \
+                        self.doc_comment_params['since'].strip()
 
         elif self.state == DBusXMLParser.STATE_INTERFACE:
             if name == DBusXMLParser.STATE_METHOD:
@@ -186,7 +187,8 @@ class DBusXMLParser:
             if 'name' in attrs and self.doc_comment_last_symbol == attrs['name']:
                 self._cur_object.doc_string = self.doc_comment_body
                 if 'since' in self.doc_comment_params:
-                    self._cur_object.since = self.doc_comment_params['since']
+                    self._cur_object.since = \
+                        self.doc_comment_params['since'].strip()
 
         elif self.state == DBusXMLParser.STATE_METHOD:
             if name == DBusXMLParser.STATE_ARG:
@@ -218,7 +220,8 @@ class DBusXMLParser:
                     if doc_string != None:
                         self._cur_object.doc_string = doc_string
                     if 'since' in self.doc_comment_params:
-                        self._cur_object.since = self.doc_comment_params['since']
+                        self._cur_object.since = \
+                            self.doc_comment_params['since'].strip()
 
         elif self.state == DBusXMLParser.STATE_SIGNAL:
             if name == DBusXMLParser.STATE_ARG:
@@ -244,7 +247,8 @@ class DBusXMLParser:
                     if doc_string != None:
                         self._cur_object.doc_string = doc_string
                     if 'since' in self.doc_comment_params:
-                        self._cur_object.since = self.doc_comment_params['since']
+                        self._cur_object.since = \
+                            self.doc_comment_params['since'].strip()
 
         elif self.state == DBusXMLParser.STATE_PROPERTY:
             if name == DBusXMLParser.STATE_ANNOTATION:


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