1#!/usr/bin/env python3
2
3"""This directory contains various SID implementations used by projects."""
4
5# this probably sort of belongs in db/ rather than top level but that
6# causes a real headache with circular depandancies basically caused by db/__init__.py
7# pulling in ts module. If we take that away if fixes many things.
8
9class SIDBase():
10 # name against tableinfo
11 _tables = {}
12
13 def table(self, name, fast_load=False):
14 from chart.db.model.table import TableInfo
15 name = name.upper()
16 existing = SIDBase._tables.get(self.name+name)
17 if existing is not None:
18 # print('sidbase cache returning existing ' + name)
19 return existing
20
21 result = TableInfo(name, sid=self, fast_load=fast_load)
22 SIDBase._tables[self.name+name] = result
23 # print('sidbase cache returning new ' + name)
24 return result