10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-28 15:16:00 +01:00
QUESTDB_website/tools/lib/formats/formatHandlerBase.py

19 lines
613 B
Python
Raw Normal View History

from abc import ABCMeta, abstractmethod
class formatHandlerBase(object, metaclass=ABCMeta):
2020-07-03 14:51:12 +02:00
def __init__(self,TexOps, commands=[]):
self.TexOps=TexOps
2020-10-08 18:41:13 +02:00
self.Commands=commands
2020-07-03 14:51:12 +02:00
@abstractmethod
def _readFromTableCore(self,table):
raise NotImplementedError()
2020-07-03 14:51:12 +02:00
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