Skip to content

Commit 11414c5

Browse files
committed
Merge pull request gregmalcolm#48 from orzrd/master
fix sensei display bug
2 parents edc86ab + aa189dd commit 11414c5

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

python2/runner/sensei.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import unittest
55
import re
66
import sys
7+
import os
78
import glob
89

910
import helper
@@ -235,6 +236,7 @@ def say_something_zenlike(self):
235236

236237
def total_lessons(self):
237238
all_lessons = self.filter_all_lessons()
239+
238240
if all_lessons:
239241
return len(all_lessons)
240242
else:
@@ -244,10 +246,10 @@ def total_koans(self):
244246
return self.tests.countTestCases()
245247

246248
def filter_all_lessons(self):
249+
cur_dir = os.path.split(os.path.realpath(__file__))[0]
247250
if not self.all_lessons:
248-
self.all_lessons = glob.glob('koans/about*.py')
251+
self.all_lessons = glob.glob('{0}/../koans/about*.py'.format(cur_dir))
249252
self.all_lessons = filter(lambda filename:
250253
"about_extra_credit" not in filename,
251254
self.all_lessons)
252-
253255
return self.all_lessons

python3/runner/sensei.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
import unittest
55
import re
6+
import os
67
import glob
78

89
from . import helper
@@ -243,8 +244,9 @@ def total_koans(self):
243244
return self.tests.countTestCases()
244245

245246
def filter_all_lessons(self):
247+
cur_dir = os.path.split(os.path.realpath(__file__))[0]
246248
if not self.all_lessons:
247-
self.all_lessons = glob.glob('koans/about*.py')
249+
self.all_lessons = glob.glob('{0}/../koans/about*.py'.format(cur_dir))
248250
self.all_lessons = list(filter(lambda filename:
249251
"about_extra_credit" not in filename,
250252
self.all_lessons))

0 commit comments

Comments
 (0)