Mercurial > repos > devteam > flanking_features
comparison utils/odict.py @ 1:8307665c4b6c draft
planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/flanking_features commit a1517c9d22029095120643bbe2c8fa53754dd2b7
| author | devteam |
|---|---|
| date | Wed, 11 Nov 2015 12:48:18 -0500 |
| parents | 90100b587723 |
| children |
comparison
equal
deleted
inserted
replaced
| 0:90100b587723 | 1:8307665c4b6c |
|---|---|
| 1 """ | 1 """ |
| 2 Ordered dictionary implementation. | 2 Ordered dictionary implementation. |
| 3 """ | 3 """ |
| 4 | 4 |
| 5 from UserDict import UserDict | 5 from UserDict import UserDict |
| 6 | |
| 6 | 7 |
| 7 class odict(UserDict): | 8 class odict(UserDict): |
| 8 """ | 9 """ |
| 9 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 | 10 http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/107747 |
| 10 | 11 |
| 11 This dictionary class extends UserDict to record the order in which items are | 12 This dictionary class extends UserDict to record the order in which items are |
| 12 added. Calling keys(), values(), items(), etc. will return results in this | 13 added. Calling keys(), values(), items(), etc. will return results in this |
| 13 order. | 14 order. |
| 14 """ | 15 """ |
| 15 def __init__( self, dict = None ): | 16 def __init__( self, dict=None ): |
| 16 self._keys = [] | 17 self._keys = [] |
| 17 UserDict.__init__( self, dict ) | 18 UserDict.__init__( self, dict ) |
| 18 | 19 |
| 19 def __delitem__( self, key ): | 20 def __delitem__( self, key ): |
| 20 UserDict.__delitem__( self, key ) | 21 UserDict.__delitem__( self, key ) |
