mirror of
https://github.com/Tiendil/pynames.git
synced 2025-09-22 04:40:47 +02:00
source loading may now be skipped on generator init
This commit is contained in:
parent
022f2a871c
commit
14dcaac892
1 changed files with 3 additions and 1 deletions
|
@ -88,13 +88,15 @@ class Template(object):
|
|||
class FromTablesGenerator(BaseGenerator):
|
||||
|
||||
SOURCE = None
|
||||
AUTOLOAD = True # you may want to set ``AUTOLOAD = False`` when subclassing table-based generator to skip soruce loading on init
|
||||
|
||||
def __init__(self):
|
||||
super(FromTablesGenerator, self).__init__()
|
||||
self.templates_choices = {}
|
||||
self.templates = []
|
||||
self.tables = {}
|
||||
self.source_loader(self.SOURCE)
|
||||
if self.AUTOLOAD:
|
||||
self.source_loader(self.SOURCE)
|
||||
|
||||
def source_loader(self, source):
|
||||
if source is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue