[PATCHv2 25/25] apibuild: Simplify getline()

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

 



Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
---
 docs/apibuild.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/docs/apibuild.py b/docs/apibuild.py
index 1f9c8f12c..5e218a9ad 100755
--- a/docs/apibuild.py
+++ b/docs/apibuild.py
@@ -432,21 +432,17 @@ class CLexer:
             line = self.input.readline()
             if not line:
                 return None
-            self.lineno = self.lineno + 1
-            line = line.lstrip()
-            line = line.rstrip()
+            self.lineno += 1
+            line = line.strip()
             if line == '':
                 continue
             while line[-1] == '\\':
                 line = line[:-1]
-                n = self.input.readline()
-                self.lineno = self.lineno + 1
-                n = n.lstrip()
-                n = n.rstrip()
+                n = self.input.readline().strip()
+                self.lineno += 1
                 if not n:
                     break
-                else:
-                    line = line + n
+                line += n
         return line
 
     def getlineno(self):
-- 
2.14.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux