diff options
author | root <root@rshg054.dnsready.net> | 2012-10-17 01:15:52 -0700 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-10-17 01:15:52 -0700 |
commit | c84b2cd310f86dc50c4f52a5907cb17652e8c87c (patch) | |
tree | ef3dc614b68e1e6f5966a5d29f3970e27bb7c4f9 /community-testing/ubuntuone-client/1339_1338.diff | |
parent | 99d0ec7ebad2eda5f3a03098962e3b250e3bef4c (diff) |
Wed Oct 17 01:14:52 PDT 2012
Diffstat (limited to 'community-testing/ubuntuone-client/1339_1338.diff')
-rw-r--r-- | community-testing/ubuntuone-client/1339_1338.diff | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/community-testing/ubuntuone-client/1339_1338.diff b/community-testing/ubuntuone-client/1339_1338.diff new file mode 100644 index 000000000..cbd966a70 --- /dev/null +++ b/community-testing/ubuntuone-client/1339_1338.diff @@ -0,0 +1,57 @@ +=== modified file 'tests/platform/sync_menu/test_linux.py' +--- tests/platform/sync_menu/test_linux.py 2012-10-10 14:54:49 +0000 ++++ tests/platform/sync_menu/test_linux.py 2012-10-11 12:01:27 +0000 +@@ -124,6 +124,7 @@ + """Check that the dummy has the proper methods required by the API.""" + dummy = linux.DummySyncMenu('random', 'args') + self.assertIsInstance(dummy.update_transfers, Callable) ++ self.assertIsInstance(dummy.sync_status_changed, Callable) + + + class SyncMenuTestCase(TestCase): + +=== modified file 'ubuntuone/platform/sync_menu/linux.py' +--- ubuntuone/platform/sync_menu/linux.py 2012-10-10 17:06:14 +0000 ++++ ubuntuone/platform/sync_menu/linux.py 2012-10-11 13:00:10 +0000 +@@ -183,7 +183,7 @@ + self.timer.addCallback(self._timeout) + + +-class TransfersMenu(Dbusmenu.Menuitem): ++class TransfersMenu(Dbusmenu.Menuitem if use_syncmenu else object): + """Menu that handles the recent and current transfers.""" + + def __init__(self, status_frontend): +@@ -227,7 +227,7 @@ + items_added = 0 + remove = [] + for item in self._uploading_items: +- if item in uploading_data: ++ if item in uploading_data.keys(): + size, written = uploading_data[item] + percentage = written * 100 / size + upload_item = self._uploading_items[item] +@@ -243,7 +243,7 @@ + for item in remove: + self._uploading_items.pop(item) + if items_added < 5: +- for item in uploading_data: ++ for item in uploading_data.keys(): + if item not in self._uploading_items and items_added < 5: + size, written = uploading_data[item] + percentage = written * 100 / size +@@ -270,4 +270,12 @@ + def update_transfers(self): + """Do nothing.""" + +-UbuntuOneSyncMenu = UbuntuOneSyncMenuLinux if use_syncmenu else DummySyncMenu ++ def sync_status_changed(self): ++ """Do nothing.""" ++ ++ ++if use_syncmenu: ++ UbuntuOneSyncMenu = UbuntuOneSyncMenuLinux ++else: ++ UbuntuOneSyncMenu = DummySyncMenu ++ TransfersMenu = None + |