Hello,
I have used the [ModuleName] FileReader and [ModuleName] FileWriter before to allow drag and drop of a file with a specific extension into my module. However, I cannot figure out how to add more than one file extension. Do you have any example of this?
The code below shows a simple FileReader, but because the name of the class matches the name of the module, I cannot add more than one extension.
class MyModuleFileReader:
def __init__(self, parent):
self.parent = parent
def description(self):
return 'Specific type'
def fileType(self):
return 'Specific'
def extensions(self):
return ['Specific (*.spc)']
def canLoadFile(self, filePath):
return filePath.endswith('.spc')
def load(self, properties):
try:
pass
except Exception as e:
logging.error('Failed to load file: ' + str(e))
import traceback
traceback.print_exc()
return False
return True