##// END OF EJS Templates
make display_status optional at runtime in setupext...
MinRK -
Show More
@@ -62,7 +62,7 b' from setupbase import ('
62 62 check_for_dependencies,
63 63 record_commit_info,
64 64 )
65 from setupext.setupext import check_for_readline
65 from setupext import setupext
66 66
67 67 isfile = os.path.isfile
68 68 pjoin = os.path.join
@@ -220,7 +220,8 b" if 'setuptools' in sys.modules:"
220 220 test='nose>=0.10.1',
221 221 )
222 222 requires = setup_args.setdefault('install_requires', [])
223 if not check_for_readline():
223 setupext.display_status = False
224 if not setupext.check_for_readline():
224 225 if sys.platform == 'darwin':
225 226 requires.append('readline')
226 227 elif sys.platform.startswith('win'):
@@ -18,10 +18,18 b' from textwrap import fill'
18 18
19 19 display_status=True
20 20
21 def check_display(f):
22 """decorator to allow display methods to be muted by mod.display_status"""
23 def maybe_display(*args, **kwargs):
21 24 if display_status:
25 return f(*args, **kwargs)
26 return maybe_display
27
28 @check_display
22 29 def print_line(char='='):
23 30 print char * 76
24 31
32 @check_display
25 33 def print_status(package, status):
26 34 initial_indent = "%22s: " % package
27 35 indent = ' ' * 24
@@ -29,18 +37,16 b' if display_status:'
29 37 initial_indent=initial_indent,
30 38 subsequent_indent=indent)
31 39
40 @check_display
32 41 def print_message(message):
33 42 indent = ' ' * 24 + "* "
34 43 print fill(str(message), width=76,
35 44 initial_indent=indent,
36 45 subsequent_indent=indent)
37 46
47 @check_display
38 48 def print_raw(section):
39 49 print section
40 else:
41 def print_line(*args, **kwargs):
42 pass
43 print_status = print_message = print_raw = print_line
44 50
45 51 #-------------------------------------------------------------------------------
46 52 # Tests for specific packages
General Comments 0
You need to be logged in to leave comments. Login now