Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
topydo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
topydo
Commits
d57d63e1
Commit
d57d63e1
authored
Nov 24, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'bgcolors'
parents
4908b64d
1684f33b
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
49 additions
and
7 deletions
+49
-7
test/data/ColorsTest5.conf
test/data/ColorsTest5.conf
+2
-0
test/data/ConfigTest4.conf
test/data/ConfigTest4.conf
+2
-0
test/test_colors.py
test/test_colors.py
+8
-0
test/test_config.py
test/test_config.py
+12
-0
topydo.conf
topydo.conf
+2
-0
topydo/lib/Config.py
topydo/lib/Config.py
+14
-0
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+9
-7
No files found.
test/data/ColorsTest5.conf
View file @
d57d63e1
...
@@ -4,3 +4,5 @@ project_color =
...
@@ -4,3 +4,5 @@ project_color =
context_color
=
context_color
=
link_color
=
link_color
=
metadata_color
=
metadata_color
=
focus_background_color
=
marked_background_color
=
test/data/ConfigTest4.conf
View file @
d57d63e1
...
@@ -24,3 +24,5 @@ project_color = junk
...
@@ -24,3 +24,5 @@ project_color = junk
context_color
=
junk
context_color
=
junk
metadata_color
=
junk
metadata_color
=
junk
link_color
=
junk
link_color
=
junk
focus_background_color
=
junk
marked_background_color
=
junk
test/test_colors.py
View file @
d57d63e1
...
@@ -154,6 +154,14 @@ class ColorsTest(TopydoTest):
...
@@ -154,6 +154,14 @@ class ColorsTest(TopydoTest):
self
.
assertEqual
(
color_b
,
''
)
self
.
assertEqual
(
color_b
,
''
)
self
.
assertEqual
(
color_c
,
''
)
self
.
assertEqual
(
color_c
,
''
)
def
test_focus_color
(
self
):
config
(
p_overrides
=
{(
'colorscheme'
,
'focus_background_color'
):
'gray'
})
self
.
assertEqual
(
config
().
focus_background_color
().
as_ansi
(),
'
\
033
[0;37m'
)
def
test_mark_color
(
self
):
config
(
p_overrides
=
{(
'colorscheme'
,
'marked_background_color'
):
'blue'
})
self
.
assertEqual
(
config
().
marked_background_color
().
as_ansi
(),
'
\
033
[0;34m'
)
def
test_empty_color_values
(
self
):
def
test_empty_color_values
(
self
):
config
(
"test/data/ColorsTest5.conf"
)
config
(
"test/data/ColorsTest5.conf"
)
project_color
=
config
().
project_color
().
as_ansi
(
p_decoration
=
'bold'
)
project_color
=
config
().
project_color
().
as_ansi
(
p_decoration
=
'bold'
)
...
...
test/test_config.py
View file @
d57d63e1
...
@@ -128,6 +128,18 @@ class ConfigTest(TopydoTest):
...
@@ -128,6 +128,18 @@ class ConfigTest(TopydoTest):
self
.
assertEqual
(
config
(
"test/data/ConfigTest5.conf"
).
link_color
().
color
,
6
)
self
.
assertEqual
(
config
(
"test/data/ConfigTest5.conf"
).
link_color
().
color
,
6
)
def
test_config24
(
self
):
def
test_config24
(
self
):
""" No focus background color value. """
self
.
assertEqual
(
config
(
"test/data/ConfigTest5.conf"
).
focus_background_color
().
color
,
7
)
def
test_config25
(
self
):
""" No mark background color value. """
self
.
assertEqual
(
config
(
"test/data/ConfigTest5.conf"
).
marked_background_color
().
color
,
4
)
def
test_config26
(
self
):
self
.
assertTrue
(
config
(
"test/data/ConfigTest4.conf"
).
focus_background_color
().
is_neutral
())
self
.
assertTrue
(
config
(
"test/data/ConfigTest4.conf"
).
marked_background_color
().
is_neutral
())
def
test_config27
(
self
):
""" column_keymap test. """
""" column_keymap test. """
keymap
,
keystates
=
config
(
"test/data/ConfigTest6.conf"
).
column_keymap
()
keymap
,
keystates
=
config
(
"test/data/ConfigTest6.conf"
).
column_keymap
()
...
...
topydo.conf
View file @
d57d63e1
...
@@ -50,6 +50,8 @@ append_parent_contexts = 0
...
@@ -50,6 +50,8 @@ append_parent_contexts = 0
;
context_color
=
magenta
;
context_color
=
magenta
;
metadata_color
=
green
;
metadata_color
=
green
;
link_color
=
light
-
cyan
;
link_color
=
light
-
cyan
;
focus_background_color
=
gray
;
marked_background_color
=
blue
[
aliases
]
[
aliases
]
;
showall
=
ls
-
x
;
showall
=
ls
-
x
...
...
topydo/lib/Config.py
View file @
d57d63e1
...
@@ -106,6 +106,8 @@ class _Config:
...
@@ -106,6 +106,8 @@ class _Config:
'metadata_color'
:
'green'
,
'metadata_color'
:
'green'
,
'link_color'
:
'cyan'
,
'link_color'
:
'cyan'
,
'priority_colors'
:
'A:cyan,B:yellow,C:blue'
,
'priority_colors'
:
'A:cyan,B:yellow,C:blue'
,
'focus_background_color'
:
'gray'
,
'marked_background_color'
:
'blue'
},
},
'aliases'
:
{
'aliases'
:
{
...
@@ -367,6 +369,18 @@ class _Config:
...
@@ -367,6 +369,18 @@ class _Config:
except
ValueError
:
except
ValueError
:
return
Color
(
self
.
cp
.
get
(
'colorscheme'
,
'link_color'
))
return
Color
(
self
.
cp
.
get
(
'colorscheme'
,
'link_color'
))
def
focus_background_color
(
self
):
try
:
return
Color
(
self
.
cp
.
getint
(
'colorscheme'
,
'focus_background_color'
))
except
ValueError
:
return
Color
(
self
.
cp
.
get
(
'colorscheme'
,
'focus_background_color'
))
def
marked_background_color
(
self
):
try
:
return
Color
(
self
.
cp
.
getint
(
'colorscheme'
,
'marked_background_color'
))
except
ValueError
:
return
Color
(
self
.
cp
.
get
(
'colorscheme'
,
'marked_background_color'
))
def
auto_creation_date
(
self
):
def
auto_creation_date
(
self
):
try
:
try
:
return
self
.
cp
.
getboolean
(
'add'
,
'auto_creation_date'
)
return
self
.
cp
.
getboolean
(
'add'
,
'auto_creation_date'
)
...
...
topydo/ui/columns/Main.py
View file @
d57d63e1
...
@@ -193,18 +193,20 @@ class UIApplication(CLIApplicationBase):
...
@@ -193,18 +193,20 @@ class UIApplication(CLIApplicationBase):
context_color
=
to_urwid_color
(
config
().
context_color
())
context_color
=
to_urwid_color
(
config
().
context_color
())
metadata_color
=
to_urwid_color
(
config
().
metadata_color
())
metadata_color
=
to_urwid_color
(
config
().
metadata_color
())
link_color
=
to_urwid_color
(
config
().
link_color
())
link_color
=
to_urwid_color
(
config
().
link_color
())
focus_background_color
=
to_urwid_color
(
config
().
focus_background_color
())
marked_background_color
=
to_urwid_color
(
config
().
marked_background_color
())
palette
=
[
palette
=
[
(
PaletteItem
.
PROJECT
,
''
,
''
,
''
,
project_color
,
''
),
(
PaletteItem
.
PROJECT
,
''
,
''
,
''
,
project_color
,
''
),
(
PaletteItem
.
PROJECT_FOCUS
,
''
,
'light gray'
,
''
,
project_color
,
None
),
(
PaletteItem
.
PROJECT_FOCUS
,
''
,
'light gray'
,
''
,
project_color
,
focus_background_color
),
(
PaletteItem
.
CONTEXT
,
''
,
''
,
''
,
context_color
,
''
),
(
PaletteItem
.
CONTEXT
,
''
,
''
,
''
,
context_color
,
''
),
(
PaletteItem
.
CONTEXT_FOCUS
,
''
,
'light gray'
,
''
,
context_color
,
None
),
(
PaletteItem
.
CONTEXT_FOCUS
,
''
,
'light gray'
,
''
,
context_color
,
focus_background_color
),
(
PaletteItem
.
METADATA
,
''
,
''
,
''
,
metadata_color
,
''
),
(
PaletteItem
.
METADATA
,
''
,
''
,
''
,
metadata_color
,
''
),
(
PaletteItem
.
METADATA_FOCUS
,
''
,
'light gray'
,
''
,
metadata_color
,
None
),
(
PaletteItem
.
METADATA_FOCUS
,
''
,
'light gray'
,
''
,
metadata_color
,
focus_background_color
),
(
PaletteItem
.
LINK
,
''
,
''
,
''
,
link_color
,
''
),
(
PaletteItem
.
LINK
,
''
,
''
,
''
,
link_color
,
''
),
(
PaletteItem
.
LINK_FOCUS
,
''
,
'light gray'
,
''
,
link_color
,
None
),
(
PaletteItem
.
LINK_FOCUS
,
''
,
'light gray'
,
''
,
link_color
,
focus_background_color
),
(
PaletteItem
.
DEFAULT_FOCUS
,
'
black'
,
'light gray'
),
(
PaletteItem
.
DEFAULT_FOCUS
,
'
'
,
'light gray'
,
''
,
''
,
focus_background_color
),
(
PaletteItem
.
MARKED
,
''
,
'light blue'
),
(
PaletteItem
.
MARKED
,
''
,
'light blue'
,
''
,
''
,
marked_background_color
),
]
]
for
C
in
ascii_uppercase
:
for
C
in
ascii_uppercase
:
...
@@ -217,7 +219,7 @@ class UIApplication(CLIApplicationBase):
...
@@ -217,7 +219,7 @@ class UIApplication(CLIApplicationBase):
'pri_'
+
C
,
''
,
''
,
''
,
pri_color
,
''
'pri_'
+
C
,
''
,
''
,
''
,
pri_color
,
''
))
))
palette
.
append
((
palette
.
append
((
'pri_'
+
C
+
'_focus'
,
''
,
'light gray'
,
''
,
pri_color_focus
,
None
'pri_'
+
C
+
'_focus'
,
''
,
'light gray'
,
''
,
pri_color_focus
,
focus_background_color
))
))
return
palette
return
palette
...
...
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