Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
ba3932ac
Commit
ba3932ac
authored
Jan 23, 2012
by
willmcgugan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some tweaks to make colours consistent on commandline apps
parent
bcf4f7e5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
7 deletions
+7
-7
fs/commands/fstree.py
+2
-2
fs/commands/runner.py
+5
-5
No files found.
fs/commands/fstree.py
View file @
ba3932ac
...
...
@@ -47,7 +47,7 @@ Recursively display the contents of PATH in an ascii tree"""
max_levels
=
None
else
:
max_levels
=
options
.
depth
self
.
output
(
args
[
0
]
+
'
\n
'
)
self
.
output
(
self
.
wrap_dirname
(
args
[
0
]
+
'
\n
'
)
)
dircount
,
filecount
=
print_fs
(
fs
,
path
or
''
,
file_out
=
self
.
output_file
,
max_levels
=
max_levels
,
...
...
@@ -56,7 +56,7 @@ Recursively display the contents of PATH in an ascii tree"""
dirs_first
=
options
.
dirsfirst
,
files_wildcard
=
options
.
pattern
,
dirs_only
=
options
.
dirsonly
)
self
.
output
_file
.
write
(
'
\n
'
)
self
.
output
(
'
\n
'
)
def
pluralize
(
one
,
many
,
count
):
if
count
==
1
:
return
'
%
i
%
s'
%
(
count
,
one
)
...
...
fs/commands/runner.py
View file @
ba3932ac
...
...
@@ -97,7 +97,7 @@ class Command(object):
def
wrap_dirname
(
self
,
dirname
):
if
not
self
.
terminal_colors
:
return
dirname
return
'
\x1b
[1;3
2
m
%
s
\x1b
[0m'
%
dirname
return
'
\x1b
[1;3
4
m
%
s
\x1b
[0m'
%
dirname
def
wrap_error
(
self
,
msg
):
if
not
self
.
terminal_colors
:
...
...
@@ -110,11 +110,11 @@ class Command(object):
return
fname
if
'://'
in
fname
:
return
fname
if
'.'
in
fname
:
name
,
ext
=
splitext
(
fname
)
fname
=
u'
%
s
\x1b
[36m
%
s
\x1b
[0m'
%
(
name
,
ext
)
#
if '.' in fname:
#
name, ext = splitext(fname)
#
fname = u'%s\x1b[36m%s\x1b[0m' % (name, ext)
if
isdotfile
(
fname
):
fname
=
u'
\x1b
[2
m
%
s
\x1b
[0m'
%
fname
fname
=
'
\x1b
[33
m
%
s
\x1b
[0m'
%
fname
return
fname
def
wrap_faded
(
self
,
text
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment