Skip to content

Commit

Permalink
Added SWIG 3 support. Fixes Unknown SWIG preprocessor directive error.
Browse files Browse the repository at this point in the history
  • Loading branch information
georgyberdyshev committed Mar 28, 2016
1 parent cf4956f commit 6962ef6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions ascxx/ascpy.i
Expand Up @@ -201,7 +201,7 @@ class UnitsM;
%rename(__str__) Dimensions::toString;

%extend Dimensions{
%pythoncode {
%pythoncode %{

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

return Units(str)

}
%}
}

/*
Expand Down Expand Up @@ -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():
Expand All @@ -327,7 +327,7 @@ public:
return None

return _units;
}
%}
}

typedef enum{
Expand Down Expand Up @@ -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():
Expand Down Expand Up @@ -528,7 +528,7 @@ public:
def __radd__(self,other):
a,b = self.__coerce__(other)
return b + a
}
%}
}

/*
Expand Down
4 changes: 2 additions & 2 deletions ascxx/plot.i
Expand Up @@ -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)
Expand Down Expand Up @@ -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.