Commit 4c8390ea authored by Bram Schoenmakers's avatar Bram Schoenmakers

Use Unicode strings, and use the six compatibility library for that.

parent afadc39a
......@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import urwid
from six import u
class CommandLineWidget(urwid.Edit):
def __init__(self, *args, **kwargs):
......@@ -22,7 +23,7 @@ class CommandLineWidget(urwid.Edit):
urwid.register_signal(CommandLineWidget, ['blur', 'execute_command'])
def clear(self):
self.set_edit_text(u"")
self.set_edit_text(u(""))
def _blur(self):
self.clear()
......
......@@ -15,9 +15,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import urwid
from six import u
class ConsoleWidget(urwid.LineBox):
def __init__(self, p_text=""):
def __init__(self, p_text=u("")):
urwid.register_signal(ConsoleWidget, ['close'])
self.text = urwid.Text(p_text)
......@@ -36,4 +37,4 @@ class ConsoleWidget(urwid.LineBox):
self.text.set_text(self.text.text + p_text)
def clear(self):
self.text.set_text("")
self.text.set_text(u(""))
......@@ -15,6 +15,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import urwid
from six import u
from topydo.cli.CLIApplicationBase import CLIApplicationBase
from topydo.Commands import get_subcommand
......@@ -33,7 +34,7 @@ class UIApplication(CLIApplicationBase):
super(UIApplication, self).__init__()
self.columns = urwid.Columns([], dividechars=0, min_width=COLUMN_WIDTH)
self.commandline = CommandLineWidget('topydo> ')
self.commandline = CommandLineWidget(u('topydo> '))
self.console = ConsoleWidget()
urwid.connect_signal(self.commandline, 'blur',
......
......@@ -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/>.
from six import text_type
from six import text_type, u
import urwid
from topydo.ui.TodoWidget import TodoWidget
......@@ -34,7 +34,7 @@ class TodoListWidget(urwid.LineBox):
pile = urwid.Pile([
(1, title_widget),
(1, urwid.Filler(urwid.Divider(u'\u2500'))),
(1, urwid.Filler(urwid.Divider(u('\u2500')))),
('weight', 1, self.listbox),
])
......@@ -56,7 +56,7 @@ class TodoListWidget(urwid.LineBox):
for todo in self.view.todos:
todowidget = TodoWidget(todo, self.view.todolist.number(todo))
self.todolist.append(todowidget)
self.todolist.append(urwid.Divider(u'-'))
self.todolist.append(urwid.Divider(u('-')))
if old_focus_position:
self.todolist.set_focus(old_focus_position)
......
......@@ -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/>.
from six import text_type
from six import text_type, u
import urwid
......@@ -23,7 +23,7 @@ class TodoWidget(urwid.WidgetWrap):
self.todo = p_todo
priority = self.todo.priority()
priority_text = u""
priority_text = u("")
todo_text = self.todo.source()
if priority:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment