freemyipod r514 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r513‎ | r514 | r515 >
Date:21:24, 4 February 2011
Author:farthen
Status:new
Tags:
Comment:
emcore tools/misc.py: Allow converting c_enum objects to int
Modified paths:
  • /emcore/trunk/tools/misc.py (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/misc.py
@@ -139,6 +139,9 @@
140140 def __repr__(self):
141141 return self.__str__()
142142
 143+ def __int__(self):
 144+ return self.value
 145+
143146 def __eq__(self, other):
144147 if type(other) == str:
145148 try: return getattr(self, other) == self.value