abbi031892 / periscope

Automatically exported from code.google.com/p/periscope
0 stars 0 forks source link

deactivatePlugin throws an error because it uses -= on a list #155

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. p = periscope.Periscope('cache')
2. p.deactivatePlugin('LegendasTV')
3.

The function tries to use -= to remove an item from the self.pluginNames list, 
it should use .remove()

A patch:

From fb381ba0dfd4ba797d6d6ce7cde81b2e2737ba58 Mon Sep 17 00:00:00 2001
From: Peter Wagenaar <sakartu@gmail.com>
Date: Fri, 17 Jan 2014 01:26:36 +0100
Subject: [PATCH] Change the deactivatePlugin method to use .remove() on the
 pluginNames list instead of -=

---
 periscope/periscope.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/periscope/periscope.py b/periscope/periscope.py
index 8c91646..0b543bb 100755
--- a/periscope/periscope.py
+++ b/periscope/periscope.py
@@ -124,7 +124,7 @@ class Periscope:

     def deactivatePlugin(self, pluginName):
         ''' Remove a plugin from the list '''
-        self.pluginNames -= pluginName
+        self.pluginNames.remove(pluginName)
         self.set_preferedPlugins(self.pluginNames)

     def activatePlugin(self, pluginName):
--
1.7.9.5

Original issue reported on code.google.com by saka...@gmail.com on 17 Jan 2014 at 12:28