[Sugar-devel] [PATCH sugar 20/21] pylint cleanup: don't override variables from outer scope

Sascha Silbe sascha-pgp at silbe.org
Sat Oct 16 18:20:22 EDT 2010


If two different entities have the same name, things get messy.

Signed-off-by: Sascha Silbe <sascha-pgp at silbe.org>

diff --git a/src/jarabe/desktop/schoolserver.py b/src/jarabe/desktop/schoolserver.py
index 720fc40..aea2357 100644
--- a/src/jarabe/desktop/schoolserver.py
+++ b/src/jarabe/desktop/schoolserver.py
@@ -50,7 +50,7 @@ def _generate_serial_number():
     return serial
 
 
-def _store_identifiers(serial_number, uuid, backup_url):
+def _store_identifiers(serial_number, uuid_, backup_url):
     """  Stores the serial number, uuid and backup_url
     in the identifier folder inside the profile directory
     so that these identifiers can be used for backup. """
@@ -68,7 +68,7 @@ def _store_identifiers(serial_number, uuid, backup_url):
     if os.path.exists(os.path.join(identifier_path, 'uuid')):
         os.remove(os.path.join(identifier_path, 'uuid'))
     uuid_file = open(os.path.join(identifier_path, 'uuid'), 'w')
-    uuid_file.write(uuid)
+    uuid_file.write(uuid_)
     uuid_file.close()
 
     if os.path.exists(os.path.join(identifier_path, 'backup_url')):
diff --git a/src/jarabe/model/filetransfer.py b/src/jarabe/model/filetransfer.py
index f842345..710c3a4 100644
--- a/src/jarabe/model/filetransfer.py
+++ b/src/jarabe/model/filetransfer.py
@@ -356,11 +356,12 @@ def file_transfer_available():
 if __name__ == '__main__':
     import tempfile
 
-    input_stream = gio.File('/home/tomeu/isos/Soas2-200904031934.iso').read()
-    output_stream = gio.File(tempfile.mkstemp()[1]).append_to()
+    test_file_name = '/home/tomeu/isos/Soas2-200904031934.iso'
+    test_input_stream = gio.File(test_file_name).read()
+    test_output_stream = gio.File(tempfile.mkstemp()[1]).append_to()
 
     # TODO: Use splice_async when it gets implemented
-    splicer = StreamSplicer(input_stream, output_stream)
+    splicer = StreamSplicer(test_input_stream, test_output_stream)
     splicer.start()
 
     loop = gobject.MainLoop()
diff --git a/src/jarabe/model/friends.py b/src/jarabe/model/friends.py
index c85bdb7..8f13da8 100644
--- a/src/jarabe/model/friends.py
+++ b/src/jarabe/model/friends.py
@@ -49,7 +49,7 @@ class FriendBuddyModel(BuddyModel):
         if buddy is not None:
             self._set_online_buddy(buddy)
 
-    def __buddy_added_cb(self, neighborhood, buddy):
+    def __buddy_added_cb(self, model_, buddy):
         if buddy.key != self.key:
             return
         self._set_online_buddy(buddy)
@@ -60,7 +60,7 @@ class FriendBuddyModel(BuddyModel):
         self.notify('color')
         self.notify('present')
 
-    def __buddy_removed_cb(self, neighborhood, buddy):
+    def __buddy_removed_cb(self, model_, buddy):
         if buddy.key != self.key:
             return
         self._online_buddy = None
-- 
1.7.1



More information about the Sugar-devel mailing list