c2b4999d0d2a — Greg Malcolm 13 years ago
Fixed color initialization and koans filtering bugs for windows users
2 files changed, 10 insertions(+), 4 deletions(-)

M python 2/runner/sensei.py
M python 3/runner/sensei.py
M python 2/runner/sensei.py +5 -2
@@ 10,6 10,7 @@ from mockable_test_result import Mockabl
 from runner import path_to_enlightenment
 
 from libs.colorama import init, Fore, Style
+init() # init colorama
 
 class Sensei(MockableTestResult):
     def __init__(self, stream):

          
@@ 239,6 240,8 @@ class Sensei(MockableTestResult):
     def filter_all_lessons(self):
         if not self.all_lessons:
             self.all_lessons = glob.glob('koans/about*.py')
-            self.all_lessons.remove('koans/about_extra_credit.py')
-
+            self.all_lessons = filter(lambda filename:
+                                      "about_extra_credit" not in filename,
+                                      self.all_lessons)
+            
         return self.all_lessons

          
M python 3/runner/sensei.py +5 -2
@@ 10,6 10,7 @@ from .mockable_test_result import Mockab
 from runner import path_to_enlightenment
 
 from libs.colorama import init, Fore, Style
+init() # init colorama
 
 class Sensei(MockableTestResult):
     def __init__(self, stream):

          
@@ 239,6 240,8 @@ class Sensei(MockableTestResult):
     def filter_all_lessons(self):
         if not self.all_lessons:
             self.all_lessons = glob.glob('koans/about*.py')
-            self.all_lessons.remove('koans/about_extra_credit.py')
+            self.all_lessons = list(filter(lambda filename:
+                                      "about_extra_credit" not in filename,
+                                      self.all_lessons))
 
-        return self.all_lessons      
+        return self.all_lessons