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
4c8390ea
Commit
4c8390ea
authored
Jun 21, 2015
by
Bram Schoenmakers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Unicode strings, and use the six compatibility library for that.
parent
afadc39a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
9 deletions
+12
-9
topydo/ui/CommandLineWidget.py
topydo/ui/CommandLineWidget.py
+2
-1
topydo/ui/ConsoleWidget.py
topydo/ui/ConsoleWidget.py
+3
-2
topydo/ui/Main.py
topydo/ui/Main.py
+2
-1
topydo/ui/TodoListWidget.py
topydo/ui/TodoListWidget.py
+3
-3
topydo/ui/TodoWidget.py
topydo/ui/TodoWidget.py
+2
-2
No files found.
topydo/ui/CommandLineWidget.py
View file @
4c8390ea
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
urwid
import
urwid
from
six
import
u
class
CommandLineWidget
(
urwid
.
Edit
):
class
CommandLineWidget
(
urwid
.
Edit
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
...
@@ -22,7 +23,7 @@ class CommandLineWidget(urwid.Edit):
...
@@ -22,7 +23,7 @@ class CommandLineWidget(urwid.Edit):
urwid
.
register_signal
(
CommandLineWidget
,
[
'blur'
,
'execute_command'
])
urwid
.
register_signal
(
CommandLineWidget
,
[
'blur'
,
'execute_command'
])
def
clear
(
self
):
def
clear
(
self
):
self
.
set_edit_text
(
u
""
)
self
.
set_edit_text
(
u
(
""
)
)
def
_blur
(
self
):
def
_blur
(
self
):
self
.
clear
()
self
.
clear
()
...
...
topydo/ui/ConsoleWidget.py
View file @
4c8390ea
...
@@ -15,9 +15,10 @@
...
@@ -15,9 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
urwid
import
urwid
from
six
import
u
class
ConsoleWidget
(
urwid
.
LineBox
):
class
ConsoleWidget
(
urwid
.
LineBox
):
def
__init__
(
self
,
p_text
=
""
):
def
__init__
(
self
,
p_text
=
u
(
""
)
):
urwid
.
register_signal
(
ConsoleWidget
,
[
'close'
])
urwid
.
register_signal
(
ConsoleWidget
,
[
'close'
])
self
.
text
=
urwid
.
Text
(
p_text
)
self
.
text
=
urwid
.
Text
(
p_text
)
...
@@ -36,4 +37,4 @@ class ConsoleWidget(urwid.LineBox):
...
@@ -36,4 +37,4 @@ class ConsoleWidget(urwid.LineBox):
self
.
text
.
set_text
(
self
.
text
.
text
+
p_text
)
self
.
text
.
set_text
(
self
.
text
.
text
+
p_text
)
def
clear
(
self
):
def
clear
(
self
):
self
.
text
.
set_text
(
""
)
self
.
text
.
set_text
(
u
(
""
)
)
topydo/ui/Main.py
View file @
4c8390ea
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import
urwid
import
urwid
from
six
import
u
from
topydo.cli.CLIApplicationBase
import
CLIApplicationBase
from
topydo.cli.CLIApplicationBase
import
CLIApplicationBase
from
topydo.Commands
import
get_subcommand
from
topydo.Commands
import
get_subcommand
...
@@ -33,7 +34,7 @@ class UIApplication(CLIApplicationBase):
...
@@ -33,7 +34,7 @@ class UIApplication(CLIApplicationBase):
super
(
UIApplication
,
self
).
__init__
()
super
(
UIApplication
,
self
).
__init__
()
self
.
columns
=
urwid
.
Columns
([],
dividechars
=
0
,
min_width
=
COLUMN_WIDTH
)
self
.
columns
=
urwid
.
Columns
([],
dividechars
=
0
,
min_width
=
COLUMN_WIDTH
)
self
.
commandline
=
CommandLineWidget
(
'topydo> '
)
self
.
commandline
=
CommandLineWidget
(
u
(
'topydo> '
)
)
self
.
console
=
ConsoleWidget
()
self
.
console
=
ConsoleWidget
()
urwid
.
connect_signal
(
self
.
commandline
,
'blur'
,
urwid
.
connect_signal
(
self
.
commandline
,
'blur'
,
...
...
topydo/ui/TodoListWidget.py
View file @
4c8390ea
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
six
import
text_type
from
six
import
text_type
,
u
import
urwid
import
urwid
from
topydo.ui.TodoWidget
import
TodoWidget
from
topydo.ui.TodoWidget
import
TodoWidget
...
@@ -34,7 +34,7 @@ class TodoListWidget(urwid.LineBox):
...
@@ -34,7 +34,7 @@ class TodoListWidget(urwid.LineBox):
pile
=
urwid
.
Pile
([
pile
=
urwid
.
Pile
([
(
1
,
title_widget
),
(
1
,
title_widget
),
(
1
,
urwid
.
Filler
(
urwid
.
Divider
(
u
'
\
u2500
'
))),
(
1
,
urwid
.
Filler
(
urwid
.
Divider
(
u
(
'
\
u2500
'
)
))),
(
'weight'
,
1
,
self
.
listbox
),
(
'weight'
,
1
,
self
.
listbox
),
])
])
...
@@ -56,7 +56,7 @@ class TodoListWidget(urwid.LineBox):
...
@@ -56,7 +56,7 @@ class TodoListWidget(urwid.LineBox):
for
todo
in
self
.
view
.
todos
:
for
todo
in
self
.
view
.
todos
:
todowidget
=
TodoWidget
(
todo
,
self
.
view
.
todolist
.
number
(
todo
))
todowidget
=
TodoWidget
(
todo
,
self
.
view
.
todolist
.
number
(
todo
))
self
.
todolist
.
append
(
todowidget
)
self
.
todolist
.
append
(
todowidget
)
self
.
todolist
.
append
(
urwid
.
Divider
(
u
'-'
))
self
.
todolist
.
append
(
urwid
.
Divider
(
u
(
'-'
)
))
if
old_focus_position
:
if
old_focus_position
:
self
.
todolist
.
set_focus
(
old_focus_position
)
self
.
todolist
.
set_focus
(
old_focus_position
)
...
...
topydo/ui/TodoWidget.py
View file @
4c8390ea
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from
six
import
text_type
from
six
import
text_type
,
u
import
urwid
import
urwid
...
@@ -23,7 +23,7 @@ class TodoWidget(urwid.WidgetWrap):
...
@@ -23,7 +23,7 @@ class TodoWidget(urwid.WidgetWrap):
self
.
todo
=
p_todo
self
.
todo
=
p_todo
priority
=
self
.
todo
.
priority
()
priority
=
self
.
todo
.
priority
()
priority_text
=
u
""
priority_text
=
u
(
""
)
todo_text
=
self
.
todo
.
source
()
todo_text
=
self
.
todo
.
source
()
if
priority
:
if
priority
:
...
...
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