Skip to content

Commit 2d692d7

Browse files
committed
Merge pull request #60 from mtezzele/multiple_ext
multiple extensions and tests
2 parents 24dd59a + 50afc83 commit 2d692d7

File tree

6 files changed

+815
-6
lines changed

6 files changed

+815
-6
lines changed

pygem/filehandler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def _check_extension(self, filename):
4646
:param string filename: file to check.
4747
"""
4848
__, file_ext = os.path.splitext(filename)
49-
if not file_ext == self.extension:
49+
if not file_ext in self.extension:
5050
raise ValueError('The input file does not have the proper extension. \
5151
It is %s, instead of %s.' % (file_ext, self.extension))
5252

pygem/igeshandler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,14 @@ class IgesHandler(fh.FileHandler):
2727
2828
:cvar string infile: name of the input file to be processed.
2929
:cvar string outfile: name of the output file where to write in.
30-
:cvar string extension: extension of the input/output files. It is equal to '.iges'.
30+
:cvar list extension: list of extensions of the input/output files.
31+
It is equal to ['.iges', '.igs'].
3132
:cvar list control_point_position: index of the first NURBS control point (or pole)
3233
of each face of the iges file.
3334
"""
3435
def __init__(self):
3536
super(IgesHandler, self).__init__()
36-
self.extension = '.iges' # TODO: also igs could be accepted
37+
self.extension = ['.iges', '.igs']
3738
self._control_point_position = None
3839

3940

0 commit comments

Comments
 (0)