diff options
author | emkael <emkael@tlen.pl> | 2018-10-10 02:23:12 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2018-10-10 02:23:12 +0200 |
commit | 8b17b2b021d95f9b6347152e4e95f61005a8c080 (patch) | |
tree | ec00b433cd84b407914257657a9325eb7c2f5f18 | |
parent | 5a4595fa3dc1e20a33dfba251a4b1eb9be34c5ae (diff) |
Ability to override output path in config
-rw-r--r-- | ausbutler/interface.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/ausbutler/interface.py b/ausbutler/interface.py index 2170f67..d19ba7e 100644 --- a/ausbutler/interface.py +++ b/ausbutler/interface.py @@ -21,6 +21,7 @@ class Interface(object): print 'Tournament name: %s' % (db_config['db']) self.session = get_session(db_config) self.config = config + self.output_path = self.config.get('output_path', Constants.path) self.translation = Translations() self.template = Environment(loader=FileSystemLoader('template')) self.template.filters['translate'] = self.translation.get_translation @@ -143,7 +144,7 @@ class Interface(object): Constants.shortname, round_no, segment_no ) - file(path.join(Constants.path, filename), 'w').write( + file(path.join(self.output_path, filename), 'w').write( template.render({ 'prefix': Constants.shortname, 'round_no': round_no, @@ -193,7 +194,7 @@ class Interface(object): results[r]['place'] = place previous = results[r]['norm_score'] place += 1 - file(path.join(Constants.path, filename), 'w').write( + file(path.join(self.output_path, filename), 'w').write( template.render({ 'prefix': Constants.shortname, 'logoh': Constants.logoh, @@ -275,7 +276,7 @@ class Interface(object): player['place'] = place prev = player['sum'] place += 1 - file(path.join(Constants.path, filename), 'w').write( + file(path.join(self.output_path, filename), 'w').write( template.render({ 'prefix': Constants.shortname, 'logoh': Constants.logoh, |