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
84421e39
Commit
84421e39
authored
Nov 08, 2014
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move list_limit to a ls section, move paths to topydo section.
parent
d115d38b
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
21 deletions
+23
-21
bin/topydo.conf
bin/topydo.conf
+7
-5
test/ConfigTest.py
test/ConfigTest.py
+2
-2
test/data/config1
test/data/config1
+1
-1
test/data/listcommand.conf
test/data/listcommand.conf
+1
-1
topydo/cli/Main.py
topydo/cli/Main.py
+2
-2
topydo/lib/Config.py
topydo/lib/Config.py
+10
-10
No files found.
bin/topydo.conf
View file @
84421e39
;
See
https
://
github
.
com
/
bram85
/
topydo
/
wiki
/
How
-
to
-
use
for
more
info
[
topydo
]
default_action
=
ls
default_command
=
ls
;
filename
=
todo
.
txt
;
archive_filename
=
done
.
txt
colors
=
1
highlight_projects_contexts
=
1
list_limit
=
25
[
paths
]
;
filename
=
todo
.
txt
;
archive_filename
=
done
.
txt
[
ls
]
list_limit
=
25
[
tags
]
tag_start
=
t
...
...
test/ConfigTest.py
View file @
84421e39
...
...
@@ -20,10 +20,10 @@ from Config import config
class
ConfigTest
(
unittest
.
TestCase
):
def
test_config1
(
self
):
self
.
assertEquals
(
config
(
"data/config1"
).
default_
action
(),
'do'
)
self
.
assertEquals
(
config
(
"data/config1"
).
default_
command
(),
'do'
)
def
test_config2
(
self
):
self
.
assertNotEquals
(
config
(
""
).
default_
action
(),
'do'
)
self
.
assertNotEquals
(
config
(
""
).
default_
command
(),
'do'
)
def
test_config3
(
self
):
self
.
assertTrue
(
config
(
"data/config2"
).
ignore_weekends
())
test/data/config1
View file @
84421e39
[topydo]
default_
action
= do
default_
command
= do
test/data/listcommand.conf
View file @
84421e39
[
topydo
]
[
ls
]
list_limit
=
1
topydo/cli/Main.py
View file @
84421e39
...
...
@@ -113,7 +113,7 @@ class CLIApplication(object):
try
:
subcommand
=
sys
.
argv
[
1
]
except
IndexError
:
subcommand
=
config
().
default_
action
()
subcommand
=
config
().
default_
command
()
subcommand_map
=
{
'add'
:
AddCommand
,
...
...
@@ -141,7 +141,7 @@ class CLIApplication(object):
args
=
arguments
()
if
not
subcommand
in
subcommand_map
:
subcommand
=
config
().
default_
action
()
subcommand
=
config
().
default_
command
()
args
=
arguments
(
1
)
command
=
subcommand_map
[
subcommand
](
args
,
self
.
todolist
,
...
...
topydo/lib/Config.py
View file @
84421e39
...
...
@@ -27,19 +27,19 @@ class ConfigError(Exception):
class
_Config
:
def
__init__
(
self
,
p_path
=
None
):
self
.
sections
=
[
'topydo'
,
'tags'
,
'sort'
,
'
path
s'
]
self
.
sections
=
[
'topydo'
,
'tags'
,
'sort'
,
'
l
s'
]
self
.
defaults
=
{
# topydo
'default_
action
'
:
'ls'
,
'default_
command
'
:
'ls'
,
'colors'
:
'1'
,
'highlight_projects_contexts'
:
'1'
,
'list_limit'
:
'25'
,
# paths
'filename'
:
'todo.txt'
,
'archive_filename'
:
'done.txt'
,
# ls
'list_limit'
:
'25'
,
# tags
'tag_start'
:
't'
,
'tag_due'
:
'due'
,
...
...
@@ -68,8 +68,8 @@ class _Config:
def
_home_config_path
(
self
):
return
os
.
path
.
join
(
os
.
getenv
(
'HOME'
),
'.topydo'
)
def
default_
action
(
self
):
return
self
.
cp
.
get
(
'topydo'
,
'default_
action
'
)
def
default_
command
(
self
):
return
self
.
cp
.
get
(
'topydo'
,
'default_
command
'
)
def
colors
(
self
):
try
:
...
...
@@ -84,14 +84,14 @@ class _Config:
return
self
.
defaults
[
'highlight_projects_contexts'
]
==
'1'
def
todotxt
(
self
):
return
self
.
cp
.
get
(
'
paths
'
,
'filename'
)
return
self
.
cp
.
get
(
'
topydo
'
,
'filename'
)
def
archive
(
self
):
return
self
.
cp
.
get
(
'
paths
'
,
'archive_filename'
)
return
self
.
cp
.
get
(
'
topydo
'
,
'archive_filename'
)
def
list_limit
(
self
):
try
:
return
self
.
cp
.
getint
(
'
topydo
'
,
'list_limit'
)
return
self
.
cp
.
getint
(
'
ls
'
,
'list_limit'
)
except
ValueError
:
return
int
(
self
.
defaults
[
'list_limit'
])
...
...
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