Skip to content

Commit

Permalink
Include build timestamp in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
mayo committed Jan 7, 2018
1 parent 8cd92bc commit c436501
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions hana/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import codecs
import datetime
#import importlib
import logging
import os.path
Expand Down Expand Up @@ -112,13 +113,16 @@ def plugin(self, plugin, pattern=None):
self.plugins.append((plugin, pattern))

def build(self):

self.metadata['_hana_build_time'] = datetime.datetime.utcnow()

self._process()

def _process(self):
for plugin, patterns in self.plugins:
plugin(self.files.filter(patterns), self)

#TODO: Tileset to make filtering more easier.
#TODO: FileSet to make filtering more easier.
# Filter files based on glob pattern, so in plugins:
#files.filter(glob) returns iterator/generator with matches
#TODO: This is not ideal and error prone, as it sub-calls .add, etc.
Expand Down Expand Up @@ -172,7 +176,6 @@ def add(self, filename, f):
if self._parent:
self._parent.add(filename, f)

#TODO: verify base path, resolve relative paths
def remove(self, filename):
self._files.pop(filename)

Expand Down

0 comments on commit c436501

Please sign in to comment.