mirror of
https://github.com/tbabej/taskwiki.git
synced 2025-08-23 11:27:46 +02:00
ChooseSplitProjects: Support utf-8 projects
This commit is contained in:
parent
d055dcacf4
commit
c1d1dcd1f1
1 changed files with 7 additions and 3 deletions
|
@ -450,7 +450,8 @@ class ChooseSplitProjects(CallbackSplitMixin, SplitProjects):
|
||||||
split_cursorline = True
|
split_cursorline = True
|
||||||
|
|
||||||
def _get_selected_project(self):
|
def _get_selected_project(self):
|
||||||
project_re = re.compile(r'^(?P<indent>\s*)(?P<name>[^\s]+)\s+[0-9]+$')
|
project_re = re.compile(r'^(?P<indent>\s*)(?P<name>[^\s]+)\s+[0-9]+$',
|
||||||
|
re.UNICODE)
|
||||||
|
|
||||||
project_parts = []
|
project_parts = []
|
||||||
current_indent = None
|
current_indent = None
|
||||||
|
@ -469,12 +470,15 @@ class ChooseSplitProjects(CallbackSplitMixin, SplitProjects):
|
||||||
project_parts = []
|
project_parts = []
|
||||||
|
|
||||||
project_parts.reverse()
|
project_parts.reverse()
|
||||||
return '.'.join(project_parts)
|
if six.PY2:
|
||||||
|
return u'.'.join([p.decode('utf-8') for p in project_parts])
|
||||||
|
else:
|
||||||
|
return u'.'.join(project_parts)
|
||||||
|
|
||||||
@errors.pretty_exception_handler
|
@errors.pretty_exception_handler
|
||||||
def callback(self):
|
def callback(self):
|
||||||
project = self._get_selected_project()
|
project = self._get_selected_project()
|
||||||
self.selected.modify("project:{0}".format(project))
|
self.selected.modify(u"project:{0}".format(project))
|
||||||
|
|
||||||
|
|
||||||
class SplitSummary(Split):
|
class SplitSummary(Split):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue