Permalink
Browse files

Added SWIG 3 support. Fixes Unknown SWIG preprocessor directive error.

  • Loading branch information...
georgyberdyshev committed Mar 28, 2016
1 parent cf4956f commit 6962ef6c2ca36ff6cfff85e98c2daeac82619b82
Showing with 8 additions and 8 deletions.
  1. +6 −6 ascxx/ascpy.i
  2. +2 −2 ascxx/plot.i
@@ -201,7 +201,7 @@ class UnitsM;
%rename(__str__) Dimensions::toString;

%extend Dimensions{
%pythoncode {
%pythoncode %{

def __str__(self):
return self.toString()
@@ -245,7 +245,7 @@ class UnitsM;

return Units(str)

}
%}
}

/*
@@ -308,7 +308,7 @@ public:
return self->getName().toString();
}

%pythoncode{
%pythoncode %{
def getPreferredUnits(self):
"""Return preferred units for an instance, which is done by lookup per atom type."""
if not self.isRefinedReal():
@@ -327,7 +327,7 @@ public:
return None

return _units;
}
%}
}

typedef enum{
@@ -429,7 +429,7 @@ public:
}
}

%pythoncode {
%pythoncode %{
def getSetValue(self):
"""Return the value of a set, as a integer or string Python sequence."""
if self.isSetInt():
@@ -528,7 +528,7 @@ public:
def __radd__(self,other):
a,b = self.__coerce__(other)
return b + a
}
%}
}

/*
@@ -7,7 +7,7 @@ SWIG interface for plotting from ASCEND
%include "plot.h"

%extend Plot{
%pythoncode{
%pythoncode %{
def show(self,mainloop=True):
import loading
loading.load_matplotlib(throw=True)
@@ -55,6 +55,6 @@ SWIG interface for plotting from ASCEND
# if self.getXLow() and self.getXHigh():
# matplotlib.gca().set_xlim([self.getXLow(), self.getXHigh()])
# */
}
%}
}

0 comments on commit 6962ef6

Please sign in to comment.