Home | Trees | Indices | Help |
|
---|
|
1 #!/usr/bin/env python 2 ## 3 ## Biskit, a toolkit for the manipulation of macromolecular structures 4 ## Copyright (C) 2004-2006 Raik Gruenberg & Johan Leckner 5 ## 6 ## This program is free software; you can redistribute it and/or 7 ## modify it under the terms of the GNU General Public License as 8 ## published by the Free Software Foundation; either version 2 of the 9 ## License, or any later version. 10 ## 11 ## This program is distributed in the hope that it will be useful, 12 ## but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 ## General Public License for more details. 15 ## 16 ## You find a copy of the GNU General Public License in the file 17 ## license.txt along with this program; if not, write to the Free 18 ## Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 ## 20 ## 21 ## last $Author: graik $ 22 ## last $Date: 2007/03/05 10:28:22 $ 23 ## $Revision: 2.8 $ 24 25 """ 26 List that blocks any modifications 27 """ 2829 -class FixedListError( Exception ):30 pass3133 """ 34 List that blocks any modifications. Implementing lists must override 35 fixed() to allow adding of items under some circumstances (like during 36 creation of the list). 37 """ 3881 82 83 84 ############# 85 ## TESTING 86 ############# 87 import Biskit.test as BT 8840 """ 41 @return: if list is fixed and modifications are prohibited 42 @rtype: true 43 """ 44 return 145 4648 """ 49 @raise FixedListError: if attempt to modify fixed list 50 """ 51 if self.fixed(): 52 raise FixedListError("Attempt to modify fixed list.")5354 - def __setitem__(self, i, v ):5758 - def __setslice__(self, i, j, v ):61 65 69 73 7778 - def __delitem__(self, i ):90 """Test case""" 91101 102 103 if __name__ == '__main__': 104 105 BT.localTest() 10692 - def test_FixedList(self):
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0alpha3 on Tue May 1 22:35:19 2007 | http://epydoc.sourceforge.net |