Skip to content

Commit

Permalink
refs #42 -- English will always be at the first place in the language…
Browse files Browse the repository at this point in the history
… list
  • Loading branch information
brunobord committed Sep 16, 2016
1 parent bf0c0cc commit 7832544
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Fix the Italian "Cockatrice" translation (#40).
* Portuguese (Brazilian) translation of *The Black Hack* and *Additional Things* by Fernando Guedes (#41).
* Making sure that "English" will always be at the first place in the list (#42).

## 2.2.0 (2016-09-02)

Expand Down
3 changes: 3 additions & 0 deletions toolbox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class Builder(object):

exceptions = (
'build', 'static', 'templates', 'tests',
# Warning: ignoring it to add it on the top position in the list
'english',
)

def __init__(self):
Expand All @@ -48,6 +50,7 @@ def dir_list(self):
dir_list = [d for d in os.listdir('.') if d not in self.exceptions]
dir_list = filter(lambda x: os.path.isdir(x), dir_list)
dir_list = filter(lambda x: not x.startswith('.'), dir_list)
dir_list = ('english',) + tuple(dir_list)
return dir_list

def get_template(self, path):
Expand Down
5 changes: 5 additions & 0 deletions toolbox/tests/test_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ def setUp(self):
def test_dir_list_exceptions(self):
for directory in self.builder.dir_list:
self.assertFalse(directory.startswith('.'), directory)

def test_dir_list_english(self):
dir_list = tuple(self.builder.dir_list)
self.assertIn('english', dir_list)
self.assertEqual('english', dir_list[0])

0 comments on commit 7832544

Please sign in to comment.