Skip to content

Commit 5c4a82a

Browse files
committed
Upated the answers runner. Mostly for travis' benefit
1 parent 457aef3 commit 5c4a82a

27 files changed

+1347
-512
lines changed

.travis.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
language: python
2+
3+
python:
4+
- 2.7
5+
- 3.2
6+
- 3.3
7+
8+
script:
9+
- PYTHON_VER=`python -c 'import sys; print(sys.version_info[0])'`
10+
- cd python$PYTHON_VER
11+
- python _runner_tests.py
12+
# - python contemplate_koans.py # Run all the koans
13+
# - python contemplate_koans.py about_asserts about_none # Run a subset of
14+
# # koans
15+
#
16+
# Working through Python Koans in a fork? Want to use Travis CI to show which
17+
# koans you've passed? Then comment out one of the above "contemplate_koans"
18+
# lines above!
19+
#
20+
notifications:
21+
email: true
22+
23+
# Some other koans (see runner/sensei.py or "ls koans" to see the light):
24+
#
25+
# about_none about_lists about_list_assignments about_dictionaries
26+
# about_strings about_tuples about_methods about_control_statements
27+
# about_true_and_false about_sets ...

README.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Python Koans Answers
2+
====================
3+
4+
.. image:: https://travis-ci.org/gregmalcolm/python_koans.png?branch=answers
5+
:target: http://travis-ci.org/gregmalcolm/python_koans
6+
7+
*NOTE:* These answers are ANCIENT!
8+
9+
These answers were completed when Python Koans was still young back in 2010.
10+
11+
The koans have changed quite a bit since then. That said, if you're really stuck
12+
these might help push you in the right direction if you're stuck.
13+
14+
I also recommend taking a look at other peoples more modern answers in forked
15+
repos...
16+
17+
- Greg

README.txt

Lines changed: 0 additions & 145 deletions
This file was deleted.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
Copyright (c) 2010 Jonathan Hartley <tartley@tartley.com>
2+
3+
Released under the New BSD license (reproduced below), or alternatively you may
4+
use this software under any OSI approved open source license such as those at
5+
http://opensource.org/licenses/alphabetical
6+
7+
All rights reserved.
8+
9+
Redistribution and use in source and binary forms, with or without
10+
modification, are permitted provided that the following conditions are met:
11+
12+
* Redistributions of source code must retain the above copyright notice, this
13+
list of conditions and the following disclaimer.
14+
15+
* Redistributions in binary form must reproduce the above copyright notice,
16+
this list of conditions and the following disclaimer in the documentation
17+
and/or other materials provided with the distribution.
18+
19+
* Neither the name(s) of the copyright holders, nor those of its contributors
20+
may be used to endorse or promote products derived from this software without
21+
specific prior written permission.
22+
23+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
24+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+

python2/libs/colorama/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from .initialise import init
2+
from .ansi import Fore, Back, Style
3+
from .ansitowin32 import AnsiToWin32
4+
5+
VERSION = '0.1.18'
6+

python2/libs/colorama/ansi.py

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
'''
2+
This module generates ANSI character codes to printing colors to terminals.
3+
See: http://en.wikipedia.org/wiki/ANSI_escape_code
4+
'''
5+
6+
CSI = '\033['
7+
8+
def code_to_chars(code):
9+
return CSI + str(code) + 'm'
10+
11+
class AnsiCodes(object):
12+
def __init__(self, codes):
13+
for name in dir(codes):
14+
if not name.startswith('_'):
15+
value = getattr(codes, name)
16+
setattr(self, name, code_to_chars(value))
17+
18+
class AnsiFore:
19+
BLACK = 30
20+
RED = 31
21+
GREEN = 32
22+
YELLOW = 33
23+
BLUE = 34
24+
MAGENTA = 35
25+
CYAN = 36
26+
WHITE = 37
27+
RESET = 39
28+
29+
class AnsiBack:
30+
BLACK = 40
31+
RED = 41
32+
GREEN = 42
33+
YELLOW = 43
34+
BLUE = 44
35+
MAGENTA = 45
36+
CYAN = 46
37+
WHITE = 47
38+
RESET = 49
39+
40+
class AnsiStyle:
41+
BRIGHT = 1
42+
DIM = 2
43+
NORMAL = 22
44+
RESET_ALL = 0
45+
46+
Fore = AnsiCodes( AnsiFore )
47+
Back = AnsiCodes( AnsiBack )
48+
Style = AnsiCodes( AnsiStyle )
49+

0 commit comments

Comments
 (0)