- Timestamp:
- Mar 4, 2011, 2:34:28 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/abstract_2d_finite_volumes/generic_domain.py
r8124 r8125 13 13 """ 14 14 15 import types16 15 from time import time as walltime 17 16 … … 90 89 91 90 # Determine whether source is a mesh filename or coordinates 92 if type(source) == types.StringType:91 if isinstance(source, basestring): 93 92 mesh_filename = source 94 93 else: … … 861 860 def _set_region(self, functions): 862 861 # coerce to an iterable (list or tuple) 863 if type(functions) not in [types.ListType, types.TupleType]:862 if not isinstance(functions, (list, tuple)): 864 863 functions = [functions] 865 864 … … 1160 1159 if quantities is None: 1161 1160 quantities = self.evolved_quantities 1162 elif type(quantities) == types.StringType:1161 elif isinstance(quantities, basestring): 1163 1162 quantities = [quantities] #Turn it into a list 1164 1163 1165 1164 msg = ('Keyword argument quantities must be either None, ' 1166 1165 'string or list. I got %s') % str(quantities) 1167 assert type(quantities) == types.ListType, msg1166 assert isinstance(quantities, list), msg 1168 1167 1169 1168 if tags is None: 1170 1169 tags = self.get_boundary_tags() 1171 elif type(tags) == types.StringType:1170 elif isinstance(tags, basestring): 1172 1171 tags = [tags] #Turn it into a list 1173 1172 1174 1173 msg = ('Keyword argument tags must be either None, ' 1175 1174 'string or list. I got %s') % str(tags) 1176 assert type(tags) == types.ListType, msg1175 assert isinstance(tags, list), msg 1177 1176 1178 1177 # Determine width of longest quantity name (for cosmetic purposes)
Note: See TracChangeset
for help on using the changeset viewer.