Open briandk opened 11 years ago
On second thought, it might be more useful to subclass object
so that I'd have fields like this:
class ExternalFile(object):
def __init__(self):
self.filename = ""
self.assetType = ""
self.content = ""
On the output side of things, we'll loop over a collection using mustache. Here's an example for CSS:
On the Python side, each element of the stylesheets array would be a hash (perhaps of type
externalFile
) like this:Then, to create an array of such hashes (for CSS files) it might be something like
Then I just have to define a class for
externalFile
that subclassesdict
type, and a corresponding__init__
method, like