Skip to content

Commit

Permalink
Merge pull request #48 from orzrd/master
Browse files Browse the repository at this point in the history
fix sensei display bug
  • Loading branch information
gregmalcolm committed Apr 28, 2013
2 parents edc86ab + aa189dd commit 11414c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions python2/runner/sensei.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import unittest
import re
import sys
import os
import glob

import helper
Expand Down Expand Up @@ -235,6 +236,7 @@ def say_something_zenlike(self):

def total_lessons(self):
all_lessons = self.filter_all_lessons()

if all_lessons:
return len(all_lessons)
else:
Expand All @@ -244,10 +246,10 @@ def total_koans(self):
return self.tests.countTestCases()

def filter_all_lessons(self):
cur_dir = os.path.split(os.path.realpath(__file__))[0]
if not self.all_lessons:
self.all_lessons = glob.glob('koans/about*.py')
self.all_lessons = glob.glob('{0}/../koans/about*.py'.format(cur_dir))
self.all_lessons = filter(lambda filename:
"about_extra_credit" not in filename,
self.all_lessons)

return self.all_lessons
4 changes: 3 additions & 1 deletion python3/runner/sensei.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import unittest
import re
import os
import glob

from . import helper
Expand Down Expand Up @@ -243,8 +244,9 @@ def total_koans(self):
return self.tests.countTestCases()

def filter_all_lessons(self):
cur_dir = os.path.split(os.path.realpath(__file__))[0]
if not self.all_lessons:
self.all_lessons = glob.glob('koans/about*.py')
self.all_lessons = glob.glob('{0}/../koans/about*.py'.format(cur_dir))
self.all_lessons = list(filter(lambda filename:
"about_extra_credit" not in filename,
self.all_lessons))
Expand Down

0 comments on commit 11414c5

Please sign in to comment.