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
798ed50b
Commit
798ed50b
authored
May 30, 2016
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make column width configurable
Use this in the configuration file: [columns] column_width = 42
parent
016d330f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
2 deletions
+24
-2
topydo.conf
topydo.conf
+3
-0
topydo/lib/Config.py
topydo/lib/Config.py
+17
-0
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+4
-2
No files found.
topydo.conf
View file @
798ed50b
...
@@ -66,6 +66,9 @@ append_parent_contexts = 0
...
@@ -66,6 +66,9 @@ append_parent_contexts = 0
;
listcontext
=
lscon
;
listcontext
=
lscon
;
listcontexts
=
lscon
;
listcontexts
=
lscon
[
columns
]
column_width
=
40
[
column_keymap
]
[
column_keymap
]
;
Keymap
configuration
for
column
-
mode
;
Keymap
configuration
for
column
-
mode
gg
=
home
gg
=
home
...
...
topydo/lib/Config.py
View file @
798ed50b
...
@@ -52,6 +52,7 @@ class _Config:
...
@@ -52,6 +52,7 @@ class _Config:
'add'
,
'add'
,
'aliases'
,
'aliases'
,
'colorscheme'
,
'colorscheme'
,
'columns'
,
'dep'
,
'dep'
,
'ls'
,
'ls'
,
'sort'
,
'sort'
,
...
@@ -117,6 +118,10 @@ class _Config:
...
@@ -117,6 +118,10 @@ class _Config:
'listcontexts'
:
'lscon'
,
'listcontexts'
:
'lscon'
,
},
},
'columns'
:
{
'column_width'
:
'40'
,
},
'column_keymap'
:
{
'column_keymap'
:
{
'gg'
:
'home'
,
'gg'
:
'home'
,
'G'
:
'end'
,
'G'
:
'end'
,
...
@@ -383,6 +388,18 @@ class _Config:
...
@@ -383,6 +388,18 @@ class _Config:
""" Returns the list format used by `ls` """
""" Returns the list format used by `ls` """
return
self
.
cp
.
get
(
'ls'
,
'list_format'
)
return
self
.
cp
.
get
(
'ls'
,
'list_format'
)
def
column_width
(
self
):
try
:
width
=
self
.
cp
.
getint
(
'columns'
,
'column_width'
)
if
width
<
1
:
# read default
raise
ValueError
return
width
except
ValueError
:
return
int
(
self
.
defaults
[
'columns'
][
'column_width'
])
def
column_keymap
(
self
):
def
column_keymap
(
self
):
""" Returns keymap and keystates used in column mode """
""" Returns keymap and keystates used in column mode """
keystates
=
set
()
keystates
=
set
()
...
...
topydo/ui/columns/Main.py
View file @
798ed50b
...
@@ -95,12 +95,14 @@ class UIApplication(CLIApplicationBase):
...
@@ -95,12 +95,14 @@ class UIApplication(CLIApplicationBase):
self
.
_process_flags
()
self
.
_process_flags
()
self
.
column_width
=
config
().
column_width
()
self
.
todofile
=
TodoFile
.
TodoFile
(
config
().
todotxt
())
self
.
todofile
=
TodoFile
.
TodoFile
(
config
().
todotxt
())
self
.
todolist
=
TodoList
.
TodoList
(
self
.
todofile
.
read
())
self
.
todolist
=
TodoList
.
TodoList
(
self
.
todofile
.
read
())
self
.
marked_todos
=
[]
self
.
marked_todos
=
[]
self
.
columns
=
urwid
.
Columns
([],
dividechars
=
0
,
min_width
=
COLUMN_WIDTH
)
self
.
columns
=
urwid
.
Columns
([],
dividechars
=
0
,
min_width
=
config
().
column_width
())
self
.
commandline
=
CommandLineWidget
(
'topydo> '
)
self
.
commandline
=
CommandLineWidget
(
'topydo> '
)
self
.
keystate_widget
=
KeystateWidget
()
self
.
keystate_widget
=
KeystateWidget
()
self
.
status_line
=
urwid
.
Columns
([
self
.
status_line
=
urwid
.
Columns
([
...
@@ -442,7 +444,7 @@ class UIApplication(CLIApplicationBase):
...
@@ -442,7 +444,7 @@ class UIApplication(CLIApplicationBase):
options
=
self
.
columns
.
options
(
options
=
self
.
columns
.
options
(
width_type
=
'given'
,
width_type
=
'given'
,
width_amount
=
COLUMN_WIDTH
,
width_amount
=
config
().
column_width
()
,
box_widget
=
True
box_widget
=
True
)
)
...
...
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