From: <md...@us...> - 2008-10-02 14:28:53
|
Revision: 6143 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6143&view=rev Author: mdboom Date: 2008-10-02 14:28:45 +0000 (Thu, 02 Oct 2008) Log Message: ----------- Fix some python2.6 -3 warnings. (mainly usage of has_key) Modified Paths: -------------- trunk/matplotlib/boilerplate.py trunk/matplotlib/lib/matplotlib/__init__.py trunk/matplotlib/lib/matplotlib/_pylab_helpers.py trunk/matplotlib/lib/matplotlib/afm.py trunk/matplotlib/lib/matplotlib/artist.py trunk/matplotlib/lib/matplotlib/axes.py trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py trunk/matplotlib/lib/matplotlib/backends/backend_qt.py trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py trunk/matplotlib/lib/matplotlib/backends/backend_wx.py trunk/matplotlib/lib/matplotlib/collections.py trunk/matplotlib/lib/matplotlib/config/cutils.py trunk/matplotlib/lib/matplotlib/config/mplconfig.py trunk/matplotlib/lib/matplotlib/config/rcparams.py trunk/matplotlib/lib/matplotlib/figure.py trunk/matplotlib/lib/matplotlib/font_manager.py trunk/matplotlib/lib/matplotlib/image.py trunk/matplotlib/lib/matplotlib/legend.py trunk/matplotlib/lib/matplotlib/lines.py trunk/matplotlib/lib/matplotlib/mathtext.py trunk/matplotlib/lib/matplotlib/patches.py trunk/matplotlib/lib/matplotlib/scale.py trunk/matplotlib/lib/matplotlib/table.py trunk/matplotlib/lib/matplotlib/text.py trunk/matplotlib/lib/matplotlib/ticker.py trunk/matplotlib/lib/pytz/tzinfo.py trunk/matplotlib/setupext.py trunk/matplotlib/src/_tkagg.cpp Modified: trunk/matplotlib/boilerplate.py =================================================================== --- trunk/matplotlib/boilerplate.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/boilerplate.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -114,7 +114,7 @@ for func in _plotcommands: - if cmappable.has_key(func): + if func in cmappable: mappable = cmappable[func] else: mappable = '' Modified: trunk/matplotlib/lib/matplotlib/__init__.py =================================================================== --- trunk/matplotlib/lib/matplotlib/__init__.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/__init__.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -443,7 +443,7 @@ def _get_data_path(): 'get the path to matplotlib data' - if os.environ.has_key('MATPLOTLIBDATA'): + if 'MATPLOTLIBDATA' in os.environ: path = os.environ['MATPLOTLIBDATA'] if not os.path.isdir(path): raise RuntimeError('Path in environment MATPLOTLIBDATA not a directory') @@ -535,7 +535,7 @@ fname = os.path.join( os.getcwd(), 'matplotlibrc') if os.path.exists(fname): return fname - if os.environ.has_key('MATPLOTLIBRC'): + if 'MATPLOTLIBRC' in os.environ: path = os.environ['MATPLOTLIBRC'] if os.path.exists(path): fname = os.path.join(path, 'matplotlibrc') @@ -637,7 +637,7 @@ verbose.set_fileo(ret['verbose.fileo']) for key, (val, line, cnt) in rc_temp.iteritems(): - if defaultParams.has_key(key): + if key in defaultParams: if fail_on_error: ret[key] = val # try to convert to proper type or raise else: @@ -745,7 +745,7 @@ for k,v in kwargs.items(): name = aliases.get(k) or k key = '%s.%s' % (g, name) - if not rcParams.has_key(key): + if key not in rcParams: raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, g, name)) Modified: trunk/matplotlib/lib/matplotlib/_pylab_helpers.py =================================================================== --- trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/_pylab_helpers.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -31,7 +31,7 @@ destroy = staticmethod(destroy) def has_fignum(num): - return Gcf.figs.has_key(num) + return num in Gcf.figs has_fignum = staticmethod(has_fignum) def get_all_fig_managers(): Modified: trunk/matplotlib/lib/matplotlib/afm.py =================================================================== --- trunk/matplotlib/lib/matplotlib/afm.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/afm.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -263,7 +263,7 @@ if len(line)==0: continue key = line.split()[0] - if optional.has_key(key): d[key] = optional[key](fh) + if key in optional: d[key] = optional[key](fh) l = ( d['StartKernData'], d['StartComposites'] ) return l Modified: trunk/matplotlib/lib/matplotlib/artist.py =================================================================== --- trunk/matplotlib/lib/matplotlib/artist.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/artist.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -662,7 +662,7 @@ alias, return 'markerfacecolor or mfc' and for the transform property, which does not, return 'transform' """ - if self.aliasd.has_key(s): + if s in self.aliasd: return '%s or %s' % (s, self.aliasd[s]) else: return s Modified: trunk/matplotlib/lib/matplotlib/axes.py =================================================================== --- trunk/matplotlib/lib/matplotlib/axes.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/axes.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -73,17 +73,17 @@ chars = [c for c in fmt] for c in chars: - if mlines.lineStyles.has_key(c): + if c in mlines.lineStyles: if linestyle is not None: raise ValueError( 'Illegal format string "%s"; two linestyle symbols' % fmt) linestyle = c - elif mlines.lineMarkers.has_key(c): + elif c in mlines.lineMarkers: if marker is not None: raise ValueError( 'Illegal format string "%s"; two marker symbols' % fmt) marker = c - elif mcolors.colorConverter.colors.has_key(c): + elif c in mcolors.colorConverter.colors: if color is not None: raise ValueError( 'Illegal format string "%s"; two color symbols' % fmt) @@ -2632,7 +2632,7 @@ #if t.get_clip_on(): t.set_clip_box(self.bbox) - if kwargs.has_key('clip_on'): t.set_clip_box(self.bbox) + if 'clip_on' in kwargs: t.set_clip_box(self.bbox) return t text.__doc__ = cbook.dedent(text.__doc__) % martist.kwdocd Modified: trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/backends/backend_gtk.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -234,7 +234,7 @@ return False # finish event propagation? def _get_key(self, event): - if self.keyvald.has_key(event.keyval): + if event.keyval in self.keyvald: key = self.keyvald[event.keyval] elif event.keyval <256: key = chr(event.keyval) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -170,7 +170,7 @@ def _get_key( self, event ): if event.key() < 256: key = event.text().latin1() - elif self.keyvald.has_key( event.key() ): + elif event.key() in self.keyvald.has_key: key = self.keyvald[ event.key() ] else: key = None Modified: trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/backends/backend_qt4.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -174,7 +174,7 @@ def _get_key( self, event ): if event.key() < 256: key = str(event.text()) - elif self.keyvald.has_key( event.key() ): + elif event.key() in self.keyvald: key = self.keyvald[ event.key() ] else: key = None Modified: trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/backends/backend_tkagg.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -297,7 +297,7 @@ def _get_key(self, event): val = event.keysym_num - if self.keyvald.has_key(val): + if val in self.keyvald: key = self.keyvald[val] elif val<256: key = chr(val) Modified: trunk/matplotlib/lib/matplotlib/backends/backend_wx.py =================================================================== --- trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/backends/backend_wx.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -1141,7 +1141,7 @@ def _get_key(self, evt): keyval = evt.m_keyCode - if self.keyvald.has_key(keyval): + if keyval in self.keyvald: key = self.keyvald[keyval] elif keyval <256: key = chr(keyval) Modified: trunk/matplotlib/lib/matplotlib/collections.py =================================================================== --- trunk/matplotlib/lib/matplotlib/collections.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/collections.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -267,9 +267,9 @@ try: dashd = backend_bases.GraphicsContextBase.dashd if cbook.is_string_like(ls): - if dashd.has_key(ls): + if ls in dashd: dashes = [dashd[ls]] - elif cbook.ls_mapper.has_key(ls): + elif ls in cbook.ls_mapper: dashes = [dashd[cbook.ls_mapper[ls]]] else: raise ValueError() @@ -278,9 +278,9 @@ dashes = [] for x in ls: if cbook.is_string_like(x): - if dashd.has_key(x): + if x in dashd: dashes.append(dashd[x]) - elif cbook.ls_mapper.has_key(x): + elif x in cbook.ls_mapper: dashes.append(dashd[cbook.ls_mapper[x]]) else: raise ValueError() Modified: trunk/matplotlib/lib/matplotlib/config/cutils.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/cutils.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/config/cutils.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -93,7 +93,7 @@ def _get_data_path(): 'get the path to matplotlib data' - if os.environ.has_key('MATPLOTLIBDATA'): + if 'MATPLOTLIBDATA' in os.environ: path = os.environ['MATPLOTLIBDATA'] if not os.path.isdir(path): raise RuntimeError('Path in environment MATPLOTLIBDATA not a directory') @@ -167,7 +167,7 @@ fname = os.path.join( os.getcwd(), filename) if os.path.exists(fname): return fname - if os.environ.has_key('MATPLOTLIBRC'): + if 'MATPLOTLIBRC' in os.environ: path = os.environ['MATPLOTLIBRC'] if os.path.exists(path): fname = os.path.join(path, filename) Modified: trunk/matplotlib/lib/matplotlib/config/mplconfig.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/config/mplconfig.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -461,8 +461,8 @@ def keys(self): return self.tconfig_map.keys() - def has_key(self, val): - return self.tconfig_map.has_key(val) + def __contains__(self, val): + return val in self.tconfig_map def update(self, arg, **kwargs): try: Modified: trunk/matplotlib/lib/matplotlib/config/rcparams.py =================================================================== --- trunk/matplotlib/lib/matplotlib/config/rcparams.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/config/rcparams.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -19,16 +19,16 @@ class RcParams(dict): - + """A dictionary object including validation - + validating functions are defined and associated with rc parameters in rcsetup.py """ - + validate = dict([ (key, converter) for key, (default, converter) in \ defaultParams.iteritems() ]) - + def __setitem__(self, key, val): try: if key in _deprecated_map.keys(): @@ -89,7 +89,7 @@ verbose.set_fileo(ret['verbose.fileo']) for key, (val, line, cnt) in rc_temp.iteritems(): - if defaultParams.has_key(key): + if key in defaultParams: if fail_on_error: ret[key] = val # try to convert to proper type or raise else: @@ -109,7 +109,7 @@ ret['datapath'] = get_data_path() verbose.report('loaded rc file %s'%fname) - + return ret @@ -183,7 +183,7 @@ for k,v in kwargs.items(): name = aliases.get(k) or k key = '%s.%s' % (g, name) - if not rcParams.has_key(key): + if key not in rcParams: raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' % (key, g, name)) Modified: trunk/matplotlib/lib/matplotlib/figure.py =================================================================== --- trunk/matplotlib/lib/matplotlib/figure.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/figure.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -591,7 +591,7 @@ key = self._make_key(*args, **kwargs) - if self._seen.has_key(key): + if key in self._seen: ax = self._seen[key] self.sca(ax) return ax @@ -652,7 +652,7 @@ """ key = self._make_key(*args, **kwargs) - if self._seen.has_key(key): + if key in self._seen: ax = self._seen[key] self.sca(ax) return ax @@ -951,7 +951,7 @@ """ for key in ('dpi', 'facecolor', 'edgecolor'): - if not kwargs.has_key(key): + if key not in kwargs: kwargs[key] = rcParams['savefig.%s'%key] transparent = kwargs.pop('transparent', False) Modified: trunk/matplotlib/lib/matplotlib/font_manager.py =================================================================== --- trunk/matplotlib/lib/matplotlib/font_manager.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/font_manager.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -505,7 +505,7 @@ for fpath in fontfiles: verbose.report('createFontDict: %s' % (fpath), 'debug') fname = os.path.split(fpath)[1] - if seen.has_key(fname): continue + if fname in seen: continue else: seen[fname] = 1 if fontext == 'afm': try: @@ -552,33 +552,33 @@ for j in range(100, 1000, 100): font[j] = temp[wgt] - if temp.has_key(400): + if 400 in temp: for j in range(100, 1000, 100): font[j] = temp[400] - if temp.has_key(500): - if temp.has_key(400): + if 500 in temp: + if 400 in temp: for j in range(500, 1000, 100): font[j] = temp[500] else: for j in range(100, 1000, 100): font[j] = temp[500] - if temp.has_key(300): + if 300 in temp: for j in [100, 200, 300]: font[j] = temp[300] - if temp.has_key(200): - if temp.has_key(300): + if 200 in temp: + if 300 in temp: for j in [100, 200]: font[j] = temp[200] else: for j in [100, 200, 300]: font[j] = temp[200] - if temp.has_key(800): + if 800 in temp: for j in [600, 700, 800, 900]: font[j] = temp[800] - if temp.has_key(700): - if temp.has_key(800): + if 700 in temp: + if 800 in temp: for j in [600, 700]: font[j] = temp[700] else: @@ -872,7 +872,7 @@ # Create list of font paths for pathname in ['TTFPATH', 'AFMPATH']: - if os.environ.has_key(pathname): + if pathname in os.environ: ttfpath = os.environ[pathname] if ttfpath.find(';') >= 0: #win32 style paths.extend(ttfpath.split(';')) @@ -983,50 +983,50 @@ fname = None font = fontdict - if font.has_key(name): + if name in font: font = font[name] else: verbose.report('\tfindfont failed %(name)s'%locals(), 'debug') return None - if font.has_key(style): + if style in font: font = font[style] - elif style == 'italic' and font.has_key('oblique'): + elif style == 'italic' and 'oblique' in font: font = font['oblique'] - elif style == 'oblique' and font.has_key('italic'): + elif style == 'oblique' and 'italic' in font: font = font['italic'] else: verbose.report('\tfindfont failed %(name)s, %(style)s'%locals(), 'debug') return None - if font.has_key(variant): + if variant in font: font = font[variant] else: verbose.report('\tfindfont failed %(name)s, %(style)s, %(variant)s'%locals(), 'debug') return None - if not font.has_key(weight): + if weight in font: setWeights(font) - if not font.has_key(weight): + if weight not in font: return None font = font[weight] - if font.has_key(stretch): + if stretch in font: stretch_font = font[stretch] - if stretch_font.has_key('scalable'): + if 'scalable' in stretch_font: fname = stretch_font['scalable'] - elif stretch_font.has_key(size): + elif size in stretch_font: fname = stretch_font[size] if fname is None: for val in font.values(): - if val.has_key('scalable'): + if 'scalable' in val: fname = val['scalable'] break if fname is None: for val in font.values(): - if val.has_key(size): + if size in val: fname = val[size] break Modified: trunk/matplotlib/lib/matplotlib/image.py =================================================================== --- trunk/matplotlib/lib/matplotlib/image.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/image.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -334,7 +334,7 @@ """ if s is None: s = rcParams['image.interpolation'] s = s.lower() - if not self._interpd.has_key(s): + if s not in self._interpd: raise ValueError('Illegal interpolation string') self._interpolation = s Modified: trunk/matplotlib/lib/matplotlib/legend.py =================================================================== --- trunk/matplotlib/lib/matplotlib/legend.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/legend.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -148,7 +148,7 @@ if not self.isaxes and loc in [0,'best']: loc = 'upper right' if is_string_like(loc): - if not self.codes.has_key(loc): + if loc not in self.codes: if self.isaxes: warnings.warn('Unrecognized location "%s". Falling back on "best"; ' 'valid locations are\n\t%s\n' Modified: trunk/matplotlib/lib/matplotlib/lines.py =================================================================== --- trunk/matplotlib/lib/matplotlib/lines.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/lines.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -603,7 +603,7 @@ linestyle = '-' if linestyle not in self._lineStyles: - if ls_mapper.has_key(linestyle): + if linestyle in ls_mapper: linestyle = ls_mapper[linestyle] else: verbose.report('Unrecognized line style %s, %s' % Modified: trunk/matplotlib/lib/matplotlib/mathtext.py =================================================================== --- trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/mathtext.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -711,7 +711,7 @@ def _get_glyph(self, fontname, font_class, sym, fontsize): symbol_name = None - if fontname in self.fontmap and latex_to_bakoma.has_key(sym): + if fontname in self.fontmap and sym in latex_to_bakoma: basename, num = latex_to_bakoma[sym] slanted = (basename == "cmmi10") or sym in self._slanted_symbols try: @@ -1064,7 +1064,7 @@ found_symbol = False - if latex_to_standard.has_key(sym): + if sym in latex_to_standard: fontname, num = latex_to_standard[sym] glyph = chr(num) found_symbol = True Modified: trunk/matplotlib/lib/matplotlib/patches.py =================================================================== --- trunk/matplotlib/lib/matplotlib/patches.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/patches.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -1004,7 +1004,7 @@ %(Patch)s """ - if kwargs.has_key('resolution'): + if 'resolution' in kwargs: import warnings warnings.warn('Circle is now scale free. Use CirclePolygon instead!', DeprecationWarning) kwargs.pop('resolution') Modified: trunk/matplotlib/lib/matplotlib/scale.py =================================================================== --- trunk/matplotlib/lib/matplotlib/scale.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/scale.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -330,7 +330,7 @@ if scale is None: scale = 'linear' - if not _scale_mapping.has_key(scale): + if scale not in _scale_mapping: raise ValueError("Unknown scale type '%s'" % scale) return _scale_mapping[scale](axis, **kwargs) Modified: trunk/matplotlib/lib/matplotlib/table.py =================================================================== --- trunk/matplotlib/lib/matplotlib/table.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/table.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -181,7 +181,7 @@ Artist.__init__(self) - if is_string_like(loc) and not self.codes.has_key(loc): + if is_string_like(loc) and loc not in self.codes: warnings.warn('Unrecognized location %s. Falling back on bottom; valid locations are\n%s\t' %(loc, '\n\t'.join(self.codes.keys()))) loc = 'bottom' if is_string_like(loc): loc = self.codes.get(loc, 1) Modified: trunk/matplotlib/lib/matplotlib/text.py =================================================================== --- trunk/matplotlib/lib/matplotlib/text.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/text.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -222,7 +222,7 @@ def _get_layout(self, renderer): key = self.get_prop_tup() - if self.cached.has_key(key): return self.cached[key] + if key in self.cached: return self.cached[key] horizLayout = [] @@ -337,7 +337,7 @@ # rectprops and the bbox will be drawn using bbox_artist # function. This is to keep the backward compatibility. - if rectprops is not None and rectprops.has_key("boxstyle"): + if rectprops is not None and "boxstyle" in rectprops: props = rectprops.copy() boxstyle = props.pop("boxstyle") bbox_transmuter = props.pop("bbox_transmuter", None) Modified: trunk/matplotlib/lib/matplotlib/ticker.py =================================================================== --- trunk/matplotlib/lib/matplotlib/ticker.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/matplotlib/ticker.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -745,7 +745,7 @@ if vmax<vmin: vmin, vmax = vmax, vmin - if self.presets.has_key((vmin, vmax)): + if (vmin, vmax) in self.presets: return self.presets[(vmin, vmax)] if self.numticks is None: Modified: trunk/matplotlib/lib/pytz/tzinfo.py =================================================================== --- trunk/matplotlib/lib/pytz/tzinfo.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/lib/pytz/tzinfo.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -136,7 +136,7 @@ self._utcoffset, self._dst, self._tzname = self._transition_info[0] _tzinfos[self._transition_info[0]] = self for inf in self._transition_info[1:]: - if not _tzinfos.has_key(inf): + if inf not in _tzinfos: _tzinfos[inf] = self.__class__(inf, _tzinfos) def fromutc(self, dt): Modified: trunk/matplotlib/setupext.py =================================================================== --- trunk/matplotlib/setupext.py 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/setupext.py 2008-10-02 14:28:45 UTC (rev 6143) @@ -70,14 +70,6 @@ import ConfigParser import cStringIO -major, minor1, minor2, s, tmp = sys.version_info -if major<2 or (major==2 and minor1<3): - True = 1 - False = 0 -else: - True = True - False = False - BUILT_PNG = False BUILT_AGG = False BUILT_FT2FONT = False @@ -88,9 +80,9 @@ BUILT_WXAGG = False BUILT_WINDOWING = False BUILT_CONTOUR = False -BUILT_DELAUNAY = False +BUILT_DELAUNAY = False BUILT_NXUTILS = False -BUILT_TRAITS = False +BUILT_TRAITS = False BUILT_CONTOUR = False BUILT_GDK = False BUILT_PATH = False @@ -696,7 +688,7 @@ add_base_flags(module) - if not os.environ.has_key('PKG_CONFIG_PATH'): + if 'PKG_CONFIG_PATH' not in os.environ: # If Gtk+ is installed, pkg-config is required to be installed os.environ['PKG_CONFIG_PATH'] = 'C:\GTK\lib\pkgconfig' Modified: trunk/matplotlib/src/_tkagg.cpp =================================================================== --- trunk/matplotlib/src/_tkagg.cpp 2008-10-02 13:38:50 UTC (rev 6142) +++ trunk/matplotlib/src/_tkagg.cpp 2008-10-02 14:28:45 UTC (rev 6143) @@ -54,7 +54,7 @@ agg::int8u *destbuffer; double l,b,r,t; int destx, desty, destwidth, destheight, deststride; - unsigned long tmp_ptr; + //unsigned long tmp_ptr; long mode; long nval; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |