[Checkins]
SVN: Products.PluginRegistry/branches/1.1/Products/PluginRegistry/
Merge r81977 from trunk
Wichert Akkerman
wichert at wiggy.net
Sat Nov 24 09:12:37 EST 2007
Log message for revision 81978:
Merge r81977 from trunk
Changed:
U Products.PluginRegistry/branches/1.1/Products/PluginRegistry/CHANGES.txt
U Products.PluginRegistry/branches/1.1/Products/PluginRegistry/PluginRegistry.py
U Products.PluginRegistry/branches/1.1/Products/PluginRegistry/tests/test_PluginRegistry.py
U Products.PluginRegistry/branches/1.1/Products/PluginRegistry/version.txt
-=-
Modified: Products.PluginRegistry/branches/1.1/Products/PluginRegistry/CHANGES.txt
===================================================================
--- Products.PluginRegistry/branches/1.1/Products/PluginRegistry/CHANGES.txt 2007-11-24 14:11:08 UTC (rev 81977)
+++ Products.PluginRegistry/branches/1.1/Products/PluginRegistry/CHANGES.txt 2007-11-24 14:12:36 UTC (rev 81978)
@@ -1,5 +1,10 @@
PluginRegistry Product Changelog
+ PluginRegistry 1.1.3 (unreleased)
+
+ - Fix bad behaviour when moving the top plugin up.
+ (https://bugs.launchpad.net/bugs/164717)
+
PluginRegistry 1.1.2 (2007/04/24)
- Drop previously-activated plugins from the list returned from
Modified: Products.PluginRegistry/branches/1.1/Products/PluginRegistry/PluginRegistry.py
===================================================================
--- Products.PluginRegistry/branches/1.1/Products/PluginRegistry/PluginRegistry.py 2007-11-24 14:11:08 UTC (rev 81977)
+++ Products.PluginRegistry/branches/1.1/Products/PluginRegistry/PluginRegistry.py 2007-11-24 14:12:36 UTC (rev 81978)
@@ -202,8 +202,9 @@
raise IndexError, i1
i2 = i1 - 1
- if i2 < 0: # wrap to bottom
- i2 = len( ids ) - 1
+ if i2 < 0:
+ # i1 is already on top
+ continue
ids[ i2 ], ids[ i1 ] = ids[ i1 ], ids[ i2 ]
@@ -227,8 +228,9 @@
raise IndexError, i1
i2 = i1 + 1
- if i2 == len( ids ): # wrap to top
- i2 = 0
+ if i2 == len( ids ):
+ # i1 is already on the bottom
+ continue
ids[ i2 ], ids[ i1 ] = ids[ i1 ], ids[ i2 ]
Modified: Products.PluginRegistry/branches/1.1/Products/PluginRegistry/tests/test_PluginRegistry.py
===================================================================
--- Products.PluginRegistry/branches/1.1/Products/PluginRegistry/tests/test_PluginRegistry.py 2007-11-24 14:11:08 UTC (rev 81977)
+++ Products.PluginRegistry/branches/1.1/Products/PluginRegistry/tests/test_PluginRegistry.py 2007-11-24 14:12:36 UTC (rev 81978)
@@ -208,6 +208,19 @@
self.assertEqual( idlist[1], 'baz_plugin' )
self.assertEqual( idlist[2], 'foo_plugin' )
+ # Moving the top plugin up should not change anything.
+ preg.movePluginsUp( IFoo, ( 'bar_plugin', ) )
+ idlist = preg.listPluginIds( IFoo )
+ self.assertEqual(idlist,
+ ('bar_plugin', 'baz_plugin', 'foo_plugin'))
+
+ # Moving the top plugin and another one could change something.
+ preg.movePluginsUp( IFoo, ( 'bar_plugin', 'foo_plugin' ) )
+ idlist = preg.listPluginIds( IFoo )
+ self.assertEqual(idlist,
+ ('bar_plugin', 'foo_plugin', 'baz_plugin'))
+
+
def test_movePluginsDown( self ):
parent = DummyFolder()
@@ -241,6 +254,18 @@
self.assertEqual( idlist[1], 'foo_plugin' )
self.assertEqual( idlist[2], 'bar_plugin' )
+ # Moving the lowest plugin down should not change anything.
+ preg.movePluginsDown( IFoo, ( 'bar_plugin', ) )
+ idlist = preg.listPluginIds( IFoo )
+ self.assertEqual(idlist,
+ ('baz_plugin', 'foo_plugin', 'bar_plugin'))
+
+ # Moving the lowest plugin and another one could change something.
+ preg.movePluginsDown( IFoo, ( 'bar_plugin', 'baz_plugin' ) )
+ idlist = preg.listPluginIds( IFoo )
+ self.assertEqual(idlist,
+ ('foo_plugin', 'baz_plugin', 'bar_plugin'))
+
def test_getAllPlugins( self ):
parent = DummyFolder()
Modified: Products.PluginRegistry/branches/1.1/Products/PluginRegistry/version.txt
===================================================================
--- Products.PluginRegistry/branches/1.1/Products/PluginRegistry/version.txt 2007-11-24 14:11:08 UTC (rev 81977)
+++ Products.PluginRegistry/branches/1.1/Products/PluginRegistry/version.txt 2007-11-24 14:12:36 UTC (rev 81978)
@@ -1 +1 @@
-1.1.2
+1.1.3dev
More information about the Checkins
mailing list