Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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