[SCM] GUI front-end for Debian Live. branch, master, updated. 612af879898607b23ce2e07fcc9a4f9ae68b5f06

Chris Lamb chris at chris-lamb.co.uk
Tue Mar 4 15:34:29 UTC 2008


The following commit has been merged in the master branch:
commit f24476f3bb7dfacd23c7c680e0681bfabecd6cc7
Author: Chris Lamb <chris at chris-lamb.co.uk>
Date:   Tue Mar 4 15:33:44 2008 +0000

    Misc cleanups.
    
    Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>

diff --git a/DebianLive/elements/folder_of_files.py b/DebianLive/elements/folder_of_files.py
index 8ede713..73fe92b 100644
--- a/DebianLive/elements/folder_of_files.py
+++ b/DebianLive/elements/folder_of_files.py
@@ -28,7 +28,6 @@ class FolderOfFiles(dict):
                 # "Is a directory"
                 if e.errno == 21:
                     continue
-                raise e
 
     def __delitem__(self, k):
         self.stale.add(k)
@@ -66,8 +65,10 @@ class FolderOfFiles(dict):
         unique name. The file is not saved.
         """
         f = open(source, 'r')
-        source_contents = f.read()
-        f.close()
+        try:
+            source_contents = f.read()
+        finally:
+            f.close()
 
         def gen_import_name(filename):
             # Use existing filename as the root
diff --git a/DebianLive/elements/key_var.py b/DebianLive/elements/key_var.py
index 6a44582..a2eb1a4 100644
--- a/DebianLive/elements/key_var.py
+++ b/DebianLive/elements/key_var.py
@@ -78,7 +78,8 @@ class KeyVar(dict):
                     int: lambda k, v: {'': None}.get(v, None),
                     list: lambda k, v: ListObserver(v.split(), lambda: self.stale.add(k)),
                     str: lambda k, v: v,
-                    bool: lambda k, v: {'enabled' : True, 'disabled' : False, 'yes' : True, 'no' : False}.get(v, None),
+                    bool: lambda k, v: {'enabled' : True, 'disabled' : False, \
+                        'yes' : True, 'no' : False}.get(v, None),
                 }[val_type](key, val)
 
                 # Save value
diff --git a/tests/test_key_var.py b/tests/test_key_var.py
index 27d7e40..9fb7413 100755
--- a/tests/test_key_var.py
+++ b/tests/test_key_var.py
@@ -16,9 +16,9 @@ class TestKeyVar(unittest.TestCase):
     }
 
     initial = """
- LH_SPAM="eggs"
- LH_MORE_SPAM="more eggs"
-   LH_SPAM_LIST="spam eggs ham bacon"
+        LH_SPAM="eggs"
+        LH_MORE_SPAM="more eggs"
+        LH_SPAM_LIST="spam eggs ham bacon"
         LH_SPAM_BOOL="disabled"
     """
 

-- 
GUI front-end for Debian Live.



More information about the debian-live-changes mailing list