mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 05:03:53 +01:00
19 lines
613 B
Python
19 lines
613 B
Python
from abc import ABCMeta, abstractmethod
|
|
class formatHandlerBase(object, metaclass=ABCMeta):
|
|
def __init__(self,TexOps, commands=[]):
|
|
self.TexOps=TexOps
|
|
self.Commands=commands
|
|
@abstractmethod
|
|
def _readFromTableCore(self,table):
|
|
raise NotImplementedError()
|
|
|
|
def readFromTable(self,table):
|
|
dataFiles=self._readFromTableCore(table)
|
|
for file in dataFiles:
|
|
self.__applyMetadataFromOptions(file)
|
|
return dataFiles
|
|
def __applyMetadataFromOptions(self,file):
|
|
if hasattr(file, "geometry"):
|
|
file.geometry = self.TexOps.geometries[file.molecule]
|
|
file.set = self.TexOps.set
|