summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTushar Gohad <tushar.gohad@intel.com>2014-06-22 22:07:49 -0700
committerTushar Gohad <tushar.gohad@intel.com>2014-06-23 09:16:18 -0700
commit9fa733ce0636fd1f4d0f7be42f1f5794a62eacbf (patch)
tree4eef7e80b4865ca71637ce66554f7148bf6df8ef
parent5f0849d57cf7fea424f759188eeadccc41597f46 (diff)
downloadpyeclib-9fa733ce0636fd1f4d0f7be42f1f5794a62eacbf.tar.gz
core.py: Use PyECLib_HDRCHKSUM_Types/EC_Types
Signed-off-by: Tushar Gohad <tushar.gohad@intel.com>
-rw-r--r--src/python/pyeclib/core.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/python/pyeclib/core.py b/src/python/pyeclib/core.py
index 2c291a7..741f359 100644
--- a/src/python/pyeclib/core.py
+++ b/src/python/pyeclib/core.py
@@ -21,11 +21,12 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+from ec_iface import PyECLib_EC_Types
+from ec_iface import PyECLib_HDRCHKSUM_Types
import math
import pyeclib_c
import sys
-
pyver = float('%s.%s' % sys.version_info[:2])
#
@@ -48,12 +49,12 @@ class ECPyECLibDriver(object):
self.k = k
self.m = m
- if ec_type in self.ec_types:
+ if ec_type in PyECLib_EC_Types:
self.ec_type = ec_type
else:
raise ECPyECLibException("%s is not a valid EC type for PyECLib!")
- if chksum_type in self.chksum_types:
+ if chksum_type in PyECLib_HDRCHKSUM_Types:
self.chksum_type = chksum_type
else:
raise ECPyECLibException(
@@ -61,10 +62,10 @@ class ECPyECLibDriver(object):
self.inline_chksum = 0
self.algsig_chksum = 0
- if self.chksum_type == self.chksum_inline:
+ if self.chksum_type == PyECLib_HDRCHKSUM_Types.inline:
self.inline_chksum = 1
self.algsig_chksum = 0
- elif self.chksum_type == self.chksum_algsig:
+ elif self.chksum_type == PyECLib_HDRCHKSUM_Types.algsig:
self.inline_chksum = 0
self.algsig_chksum = 1