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
8ef1ae91
Commit
8ef1ae91
authored
Feb 06, 2017
by
Bram Schoenmakers
Committed by
GitHub
Feb 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #167 from mruwek/column-title
Prefer filterexpr if there is no title in config
parents
5e13411a
766acf4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
5 deletions
+11
-5
topydo/ui/columns/ColumnLayout.py
topydo/ui/columns/ColumnLayout.py
+11
-5
No files found.
topydo/ui/columns/ColumnLayout.py
View file @
8ef1ae91
...
...
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
configparse
r
from
configparser
import
RawConfigParser
,
NoOptionErro
r
from
os.path
import
expanduser
from
topydo.lib.Config
import
home_config_path
,
config
...
...
@@ -27,8 +27,15 @@ def columns(p_alt_layout_path=None):
def
_get_column_dict
(
p_cp
,
p_column
):
column_dict
=
dict
()
column_dict
[
'title'
]
=
p_cp
.
get
(
p_column
,
'title'
)
column_dict
[
'filterexpr'
]
=
p_cp
.
get
(
p_column
,
'filterexpr'
)
filterexpr
=
p_cp
.
get
(
p_column
,
'filterexpr'
)
try
:
title
=
p_cp
.
get
(
p_column
,
'title'
)
except
NoOptionError
:
title
=
filterexpr
column_dict
[
'title'
]
=
title
or
'Yet another column'
column_dict
[
'filterexpr'
]
=
filterexpr
column_dict
[
'sortexpr'
]
=
p_cp
.
get
(
p_column
,
'sortexpr'
)
column_dict
[
'groupexpr'
]
=
p_cp
.
get
(
p_column
,
'groupexpr'
)
column_dict
[
'show_all'
]
=
p_cp
.
getboolean
(
p_column
,
'show_all'
)
...
...
@@ -36,14 +43,13 @@ def columns(p_alt_layout_path=None):
return
column_dict
defaults
=
{
'title'
:
'Yet another column'
,
'filterexpr'
:
''
,
'sortexpr'
:
config
().
sort_string
(),
'groupexpr'
:
config
().
group_string
(),
'show_all'
:
'0'
,
}
cp
=
configparser
.
RawConfigParser
(
defaults
)
cp
=
RawConfigParser
(
defaults
)
files
=
[
"topydo_columns.ini"
,
"topydo_columns.conf"
,
...
...
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