home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 January / maximum-cd-2010-01.iso / DiscContents / gimp-2.6.7-i686-setup.exe / {app} / lib / gimp / 2.0 / python / gimpenums,1.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2009-08-14  |  2.1 KB  |  34 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from _gimpenums import *
  5.  
  6. class _DeprecatedConstant:
  7.     
  8.     def __init__(self, value, name, suggestion):
  9.         self._v = value
  10.         self._name = name
  11.         self._suggestion = suggestion
  12.  
  13.     
  14.     def _deprecated(self, value):
  15.         import warnings
  16.         message = '%s is deprecated, use %s instead' % (self._name, self._suggestion)
  17.         warnings.warn(message, DeprecationWarning, 3)
  18.         return value
  19.  
  20.     
  21.     __nonzero__ = lambda self: self._deprecated(self._v == True)
  22.     
  23.     __int__ = lambda self: self._deprecated(int(self._v))
  24.     
  25.     __str__ = lambda self: self._deprecated(str(self._v))
  26.     
  27.     __repr__ = lambda self: self._deprecated(repr(self._v))
  28.     
  29.     __cmp__ = lambda self, other: self._deprecated(cmp(self._v, other))
  30.  
  31. TRUE = _DeprecatedConstant(True, 'gimpenums.TRUE', 'True')
  32. FALSE = _DeprecatedConstant(False, 'gimpenums.FALSE', 'False')
  33. del _DeprecatedConstant
  34.