mirror of
https://github.com/kennethreitz/clint.git
synced 2026-06-05 06:46:16 +00:00
fix for py3.x
This commit is contained in:
@@ -17,6 +17,7 @@ import sys
|
|||||||
PY3 = sys.version_info[0] >= 3
|
PY3 = sys.version_info[0] >= 3
|
||||||
|
|
||||||
from ..packages import colorama
|
from ..packages import colorama
|
||||||
|
from ..utils import basestring
|
||||||
|
|
||||||
__all__ = (
|
__all__ = (
|
||||||
'red', 'green', 'yellow', 'blue',
|
'red', 'green', 'yellow', 'blue',
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ Module for simple interactive prompts handling
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import, print_function
|
||||||
|
|
||||||
from re import match, I
|
from re import match, I
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ def yn(prompt, default='y', batch=False):
|
|||||||
if not batch:
|
if not batch:
|
||||||
input = raw_input(prompt).strip()
|
input = raw_input(prompt).strip()
|
||||||
else:
|
else:
|
||||||
print prompt
|
print(prompt)
|
||||||
input = ''
|
input = ''
|
||||||
|
|
||||||
# If input is empty default choice is assumed
|
# If input is empty default choice is assumed
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ from os import makedirs
|
|||||||
from glob import glob
|
from glob import glob
|
||||||
|
|
||||||
try:
|
try:
|
||||||
basestring
|
basestring = basestring
|
||||||
except NameError:
|
except NameError:
|
||||||
basestring = str
|
basestring = str
|
||||||
|
|
||||||
|
|||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@@ -15,6 +17,6 @@ with indent(4, quote='>>>'):
|
|||||||
puts(colored.red('Files detected: ') + str(args.files))
|
puts(colored.red('Files detected: ') + str(args.files))
|
||||||
puts(colored.red('NOT Files detected: ') + str(args.not_files))
|
puts(colored.red('NOT Files detected: ') + str(args.not_files))
|
||||||
puts(colored.red('Grouped Arguments: ') + str(dict(args.grouped)))
|
puts(colored.red('Grouped Arguments: ') + str(dict(args.grouped)))
|
||||||
|
|
||||||
print
|
print()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user