mirror of https://github.com/django/django.git
Some Django coding style fixes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6478 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
8ae74eae55
commit
928e68192c
|
@ -2,12 +2,14 @@
|
||||||
Sets up the terminal color scheme.
|
Sets up the terminal color scheme.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from django.utils import termcolors
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from django.utils import termcolors
|
||||||
|
|
||||||
def color_style():
|
def color_style():
|
||||||
"Returns a Style object with the Django color scheme."
|
"""Returns a Style object with the Django color scheme."""
|
||||||
if sys.platform == 'win32' or sys.platform == 'Pocket PC' or sys.platform.startswith('java') or not sys.stdout.isatty():
|
if (sys.platform == 'win32' or sys.platform == 'Pocket PC'
|
||||||
|
or sys.platform.startswith('java') or not sys.stdout.isatty()):
|
||||||
return no_style()
|
return no_style()
|
||||||
class dummy: pass
|
class dummy: pass
|
||||||
style = dummy()
|
style = dummy()
|
||||||
|
@ -21,7 +23,7 @@ def color_style():
|
||||||
return style
|
return style
|
||||||
|
|
||||||
def no_style():
|
def no_style():
|
||||||
"Returns a Style object that has no colors."
|
"""Returns a Style object that has no colors."""
|
||||||
class dummy:
|
class dummy:
|
||||||
def __getattr__(self, attr):
|
def __getattr__(self, attr):
|
||||||
return lambda x: x
|
return lambda x: x
|
||||||
|
|
Loading…
Reference in New Issue