parent
5c59479577
commit
34fe1d211d
|
@ -83,18 +83,21 @@ env.filters['snake'] = snake
|
||||||
env.filters['pascal'] = pascal
|
env.filters['pascal'] = pascal
|
||||||
class template(object):
|
class template(object):
|
||||||
def __init__(self, identifier):
|
def __init__(self, identifier):
|
||||||
# TODO: directories, archives (zipfile, tarfile)
|
# TODO: archives (zipfile, tarfile)
|
||||||
self.id = identifier
|
self.id = identifier
|
||||||
if not os.path.isdir(self.path):
|
# is identifier a builtin?
|
||||||
die("{} is not a valid module template".format(identifier))
|
self.path = builtins(identifier)
|
||||||
|
if os.path.isdir(self.path):
|
||||||
|
return
|
||||||
|
# is identifier a directory?
|
||||||
|
self.path = identifier
|
||||||
|
if os.path.isdir(self.path):
|
||||||
|
return
|
||||||
|
die("{} is not a valid module template".format(identifier))
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.id
|
return self.id
|
||||||
|
|
||||||
@property
|
|
||||||
def path(self):
|
|
||||||
return builtins(self.id)
|
|
||||||
|
|
||||||
def files(self):
|
def files(self):
|
||||||
""" Lists the (local) path and content of all files in the template
|
""" Lists the (local) path and content of all files in the template
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue