# HG changeset patch
# User Burcin Erocal <burcin@erocal.org>
# Date 1270251191 7200
# Node ID 10de7f23ddb4013233504adc7abe90760884f8c9
# Parent b7495417f9a2bfb3b57aab7bb3a1a34285e3be3c
trac 6781: minor cosmetic changes to the ecl library interface.
diff git a/module_list.py b/module_list.py
a

b


398  398  ################################ 
399  399  
400  400  Extension('sage.libs.ecl', 
401   sources = ["sage/libs/ecl/ecl.pyx"], 
 401  sources = ["sage/libs/ecl.pyx"], 
402  402  libraries = ["ecl"], 
403  403  include_dirs = [SAGE_ROOT+'/local/include/ecl/'], 
404  404  depends = [SAGE_ROOT + '/local/include/ecl/ecl.h']), 
diff git a/sage/libs/ecl/ecl.pxd b/sage/libs/ecl.pxd
rename from sage/libs/ecl/ecl.pxd
rename to sage/libs/ecl.pxd
diff git a/sage/libs/ecl/ecl.pyx b/sage/libs/ecl.pyx
rename from sage/libs/ecl/ecl.pyx
rename to sage/libs/ecl.pyx
old

new


13  13  #rationals to SAGE types Integer and Rational. These parts could easily be 
14  14  #adapted to work with pure Python types. 
15  15  
16   cimport sage.rings.integer 
 16  include "../ext/interrupt.pxi" 
 17  include "../ext/stdsage.pxi" 
 18  include "../ext/cdefs.pxi" 
 19  
17  20  from sage.rings.integer cimport Integer 
18   import sage.rings.integer 
19   from sage.rings.integer import Integer 
20   cimport sage.rings.rational 
21  21  from sage.rings.rational cimport Rational 
22   import sage.rings.rational 
23  22  from sage.rings.rational import Rational 
24  23  
25  24  #it would be preferrable to let bint_symbolp wrap an efficient macro 
… 
… 

277  276  return Ct 
278  277  else: 
279  278  return Cnil 
280   elif pyobj==None: 
 279  elif pyobj is None: 
281  280  return Cnil 
282  281  elif isinstance(pyobj,int): 
283  282  return ecl_make_integer(pyobj) 
… 
… 

630  629  NotImplementedError: EclObjects can only be compared for equality 
631  630  sage: EclObject("<")(a,b) 
632  631  <ECL: T> 
633   
634  632  """ 
635   
636  633  if op == 2: # "==" 
637  634  if not(isinstance(left,EclObject)) or not(isinstance(right,EclObject)): 
638  635  return False 
… 
… 

650  647  #inappropriate for an *interface*. 
651  648  raise NotImplementedError,"EclObjects can only be compared for equality" 
652  649  
653   if not(isinstance(left,EclObject)) or not(isinstance(right,EclObject)): 
654   raise TypeError,"Can only compare EclObjects" 
655   if op == 0: # "<" 
656   pass 
657   elif op == 1: # "<=" 
658   pass 
659   elif op == 4: # ">" 
660   pass 
661   elif op == 5: # ">=" 
662   pass 
663   else: 
664   raise ValueError,"richcmp received operation code %d"%op 
 650  #if not(isinstance(left,EclObject)) or not(isinstance(right,EclObject)): 
 651  # raise TypeError,"Can only compare EclObjects" 
 652  #if op == 0: # "<" 
 653  # pass 
 654  #elif op == 1: # "<=" 
 655  # pass 
 656  #elif op == 4: # ">" 
 657  # pass 
 658  #elif op == 5: # ">=" 
 659  # pass 
 660  #else: 
 661  # raise ValueError,"richcmp received operation code %d"%op 
665  662  
666  663  def eval(self): 
667  664  r""" 
… 
… 

993  990  
994  991  #input: a clobject. Output: EclObject wrapping that. 
995  992  cdef EclObject ecl_wrap(cl_object o): 
996   cdef EclObject obj 
997   obj = EclObject() 
 993  cdef EclObject obj = PY_NEW(EclObject) 
998  994  obj.set_obj(o) 
999  995  return obj 
1000  996  