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
2bc3959f
Commit
2bc3959f
authored
Nov 08, 2016
by
Bram Schoenmakers
Committed by
GitHub
Nov 08, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #148 from mruwek/alt-column-layout
Support user-specified column-layout file
parents
5f5476fc
01753741
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
4 deletions
+22
-4
topydo/ui/columns/ColumnLayout.py
topydo/ui/columns/ColumnLayout.py
+5
-1
topydo/ui/columns/Main.py
topydo/ui/columns/Main.py
+17
-3
No files found.
topydo/ui/columns/ColumnLayout.py
View file @
2bc3959f
...
...
@@ -15,10 +15,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
configparser
from
os.path
import
expanduser
from
topydo.lib.Config
import
home_config_path
,
config
def
columns
():
def
columns
(
p_alt_layout_path
=
None
):
"""
Returns list with complete column configuration dicts.
"""
...
...
@@ -49,6 +51,8 @@ def columns():
"/etc/topydo_columns.conf"
,
]
if
p_alt_layout_path
is
not
None
:
files
.
insert
(
0
,
expanduser
(
p_alt_layout_path
))
for
filename
in
files
:
if
cp
.
read
(
filename
):
break
...
...
topydo/ui/columns/Main.py
View file @
2bc3959f
...
...
@@ -15,7 +15,9 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
datetime
import
getopt
import
shlex
import
sys
import
time
import
urwid
...
...
@@ -30,7 +32,7 @@ from topydo.lib.Utils import get_terminal_size
from
topydo.lib.View
import
View
from
topydo.lib
import
TodoFile
from
topydo.lib
import
TodoList
from
topydo.ui.CLIApplicationBase
import
CLIApplicationBase
from
topydo.ui.CLIApplicationBase
import
CLIApplicationBase
,
error
from
topydo.ui.columns.CommandLineWidget
import
CommandLineWidget
from
topydo.ui.columns.ConsoleWidget
import
ConsoleWidget
from
topydo.ui.columns.KeystateWidget
import
KeystateWidget
...
...
@@ -92,7 +94,19 @@ class UIApplication(CLIApplicationBase):
def
__init__
(
self
):
super
().
__init__
()
self
.
_process_flags
()
args
=
self
.
_process_flags
()
try
:
opts
,
args
=
getopt
.
getopt
(
args
[
1
:],
'l:'
)
except
getopt
.
GetoptError
as
e
:
error
(
str
(
e
))
sys
.
exit
(
1
)
self
.
alt_layout_path
=
None
for
opt
,
value
in
opts
:
if
opt
==
"-l"
:
self
.
alt_layout_path
=
value
self
.
column_width
=
config
().
column_width
()
self
.
todofile
=
TodoFile
.
TodoFile
(
config
().
todotxt
())
...
...
@@ -576,7 +590,7 @@ class UIApplication(CLIApplicationBase):
return
False
def
run
(
self
):
layout
=
columns
()
layout
=
columns
(
self
.
alt_layout_path
)
if
len
(
layout
)
>
0
:
for
column
in
layout
:
self
.
_add_column
(
self
.
_viewdata_to_view
(
column
))
...
...
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