NASA-PDS / pds-view

PDSView provides support for visualizing PDS3 and PDS4 data products.
https://github.com/NASA-PDS/pds-view/#pdsview
Other
21 stars 7 forks source link

Allow multiple periods ('.') in paths to pds4 xml files. #14

Closed JHofman728 closed 5 years ago

JHofman728 commented 5 years ago

Describe the bug This is a simple indexing error: Line 1128 of View.py: extension = fname.split('.')[1].upper() Will not return the extension as desired if a period proceeds it in the path.

Version of PDS View Version:

To Reproduce Create a path that has a period it it before the file name: e.g. mybrance/python2.7.12/pds4_files/test_array.xml This will not return the '7' as the extension

Expected behavior Test for a know extension. If 'XML' continue, if another know extension, assume PDS3 file and translate the file to PDS4 xml.

Fix Simple change the index to use the last period to split the string: extension = fname.split('.')[-1].upper()