Support for Python3
That was fun.
This commit is contained in:
@@ -63,9 +63,9 @@ class Color(object):
|
||||
def s(text):
|
||||
''' Returns colored string '''
|
||||
output = text
|
||||
for (key,value) in Color.replacements.iteritems():
|
||||
for (key,value) in Color.replacements.items():
|
||||
output = output.replace(key, value)
|
||||
for (key,value) in Color.colors.iteritems():
|
||||
for (key,value) in Color.colors.items():
|
||||
output = output.replace("{%s}" % key, value)
|
||||
return output
|
||||
|
||||
@@ -96,7 +96,7 @@ class Color(object):
|
||||
|
||||
if __name__ == '__main__':
|
||||
Color.pl("{R}Testing{G}One{C}Two{P}Three{W}Done")
|
||||
print Color.s("{C}Testing{P}String{W}")
|
||||
print(Color.s("{C}Testing{P}String{W}"))
|
||||
Color.pl("{+} Good line")
|
||||
Color.pl("{!} Danger")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user