diff mbox

[Branch,~linaro-image-tools/linaro-image-tools/trunk] Rev 466: Allow empty lines in Snowball startfiles config file.

Message ID 20111121143613.26791.21301.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Mattias Backman Nov. 21, 2011, 2:36 p.m. UTC
Merge authors:
  Leonid (leonid-kudryavtsev-deactivatedaccount)
  Mattias Backman (mabac)
Related merge proposals:
  https://code.launchpad.net/~mabac/linaro-image-tools/bug-797135-snowball-whitespace/+merge/82518
  proposed by: Mattias Backman (mabac)
  review: Approve - Guilherme Salgado (salgado)
------------------------------------------------------------
revno: 466 [merge]
committer: Mattias Backman <mattias.backman@linaro.org>
branch nick: linaro-image-tools
timestamp: Mon 2011-11-21 15:34:49 +0100
message:
  Allow empty lines in Snowball startfiles config file.
modified:
  linaro_image_tools/media_create/boards.py
  linaro_image_tools/media_create/tests/test_media_create.py


--
lp:linaro-image-tools
https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk

You are subscribed to branch lp:linaro-image-tools.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-image-tools/linaro-image-tools/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'linaro_image_tools/media_create/boards.py'
--- linaro_image_tools/media_create/boards.py	2011-11-16 09:01:55 +0000
+++ linaro_image_tools/media_create/boards.py	2011-11-21 14:34:49 +0000
@@ -1134,6 +1134,9 @@ 
                   'r') as info_file:
             for line in info_file:
                 file_data = line.split()
+                if len(file_data) == 0:
+                    # Line contains only whitespace
+                    continue
                 if file_data[0][0] == '#':
                     continue
                 if file_data[1].startswith('/'):

=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
--- linaro_image_tools/media_create/tests/test_media_create.py	2011-11-21 13:49:14 +0000
+++ linaro_image_tools/media_create/tests/test_media_create.py	2011-11-21 14:34:49 +0000
@@ -690,6 +690,8 @@ 
             for line in src_data:
                 # Write comments, so we test that the parser can read them
                 f.write('#Yet another comment\n')
+                # Write whitespace, so we test that the parser can handle them
+                f.write('   \n\t\n \t \t \n')
                 f.write('%s %s %i %#x %s\n' % line)
         expected = []
         # Define dummy binary files, containing nothing but their own