]> git.lyx.org Git - features.git/commitdiff
Removed stripping of whitespaces from script commands.
authorTommaso Cucinotta <tommaso@lyx.org>
Sun, 30 Jan 2011 19:44:31 +0000 (19:44 +0000)
committerTommaso Cucinotta <tommaso@lyx.org>
Sun, 30 Jan 2011 19:44:31 +0000 (19:44 +0000)
Added the capability to ignore empty lines.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37378 a592a061-630c-0410-9148-cb99ea01b6c8

development/autotests/keytest.py

index 10d32d692f98320534e46a13472a3f3b2e875202..f660d453202138bf624851c7bcdcf968f100a6eb 100755 (executable)
@@ -143,15 +143,15 @@ class CommandSourceFromFile(CommandSource):
         if self.i >= len(self.lines):
             self.loops = self.loops + 1
             if self.loops >= int(max_loops):
-                os._exit(0)
+                return None
             self.i = 0
             return 'Loop'
-        line = self.lines[self.i]
+        line = self.lines[self.i].rstrip('\n')
         self.count = self.count + 1
         self.i = self.i + 1
-        #print 'Line read: <<' + line + '>>\n'
+        #print '\nLine read: <<' + line + '>>\n'
         sys.stdout.write('r')
-        return line.rstrip('\n').rstrip()
+        return line
 
 def lyx_exists():
     if lyx_pid is None:
@@ -283,6 +283,10 @@ failed = False
 while not failed:
     #os.system('echo -n LOADAVG:; cat /proc/loadavg')
     c = x.getCommand()
+    if c is None:
+        break
+    if c == "":
+        continue
     outfile.writelines(c + '\n')
     outfile.flush()
     if c[0] == '#':