Ignore:
Timestamp:
Mar 4, 2011, 2:34:28 PM (14 years ago)
Author:
wilsonr
Message:

Changes to address ticket 360.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/pmesh/PmwBlt.py

    r3491 r8125  
    3232
    3333import string
    34 import types
    3534import Tkinter
    3635
     
    227226                self._name, 'search', start, end))
    228227    def set(self, list):
    229         if type(list) != types.TupleType:
     228        if not isinstance(list, tuple):
    230229            list = tuple(list)
    231230        self.tk.call(self._name, 'set', list)
     
    315314    def axis_configure(self, axes, option=None, **kw):
    316315        # <axes> may be a list of axisNames.
    317         if type(axes) == types.StringType:
     316        if isinstance(axes, basestring):
    318317            axes = [axes]
    319318        subcommand = (self._w, 'axis', 'configure') + tuple(axes)
     
    443442    def element_configure(self, names, option=None, **kw):
    444443        # <names> may be a list of elemNames.
    445         if type(names) == types.StringType:
     444        if isinstance(names, basestring):
    446445            names = [names]
    447446        subcommand = (self._w, 'element', 'configure') + tuple(names)
     
    505504    def pen_configure(self, names, option=None, **kw):
    506505        # <names> may be a list of penNames.
    507         if type(names) == types.StringType:
     506        if isinstance(names, basestring):
    508507            names = [names]
    509508        subcommand = (self._w, 'pen', 'configure') + tuple(names)
     
    544543    def marker_configure(self, names, option=None, **kw):
    545544        # <names> may be a list of markerIds.
    546         if type(names) == types.StringType:
     545        if isinstance(names, basestring):
    547546            names = [names]
    548547        subcommand = (self._w, 'marker', 'configure') + tuple(names)
     
    649648    def tab_configure(self, tabIndexes, option=None, **kw):
    650649        # <tabIndexes> may be a list of tabs.
    651         if type(tabIndexes) in (types.StringType, types.IntType):
     650        if isinstance(tabIndexes, (basestring, int)):
    652651            tabIndexes = [tabIndexes]
    653652        subcommand = (self._w, 'tab', 'configure') + tuple(tabIndexes)
Note: See TracChangeset for help on using the changeset viewer.