Closed akstrfn closed 8 years ago
Still, most of the functionalities are not working...
Hi @Ron89, these are all python3 commits if I remember correctly. My master branch is the same as my python3compatibility branch so there is no diff except maybe you want a pull request in a separate branch? Can you tell me what is not working for you?
When generate new checkbox/list_item:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/EditCheckbox.py", line 129, in new_checkbox
vim.current.buffer[start:start] = [unicode(nc)]
NameError: name 'unicode' is not defined
Checking checkbox with \cc
has no effect. Generating new header \hn
, etc. has no effect. Promoting header/checkbox/list with >>
nd <<
has no effect.
When attempting to insert new date with \sa
:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/Date.py", line 228, in insert_timestamp
unicode(today.strftime(u'%Y-%m-%d %a'), u'utf-8'),
TypeError: decoding str is not supported
When attempting to create new tag with \st
, after inputting tag:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/_vim.py", line 59, in r
res = f(*args, **kwargs)
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/TagsProperties.py", line 97, in set_tags
d.write()
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/vimbuffer.py", line 171, in write
for h in sorted(self._deleted_headings, cmp=lambda x, y: cmp(x._orig_start, y._orig_start), reverse=True):
TypeError: 'cmp' is an invalid keyword argument for this function
Existing tag is shown as :<:f:i:l:t:e:r: :o:b...
. Something is wrong there.
When Try to see Agenda with \caa
or \cat
Error detected while processing :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/Agenda.py", line 143, in list_next_week
agenda_documents = cls._get_agendadocuments()
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/Agenda.py", line 83, in _get_agendadocuments
return self._load_agendafiles(agenda_files)
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/Agenda.py", line 105, in _load_agendafiles
return [ORGMODE.get_document(i) for i in agenda_nums if i is not None]
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/Agenda.py", line 105, in <listcomp>
return [ORGMODE.get_document(i) for i in agenda_nums if i is not None]
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/_vim.py", line 301, in get_document
self._documents[bufnr] = VimBuffer(bufnr).init_dom()
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/vimbuffer.py", line 59, in __init__
self.update_changedtick()
File "/home/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/vimbuffer.py", line 147, in update_changedtick
(self.bufnr, vim.current.buffer.number)))
vim.error: Vim(endfunction):E171: Missing :endif
@Ron89 thanks for the details about the problems, I fixed some of them and most of the things work now. There are still some issues to be fixed (i.e. UserList issue) but I guess it is usable now so give it a spin if you want.
this can be pulled now except for an interesting thing that 'ß'.upper() returns SS but is not up to me to decide if that is ok ;) More details: https://bugs.python.org/issue4610
It seems the code has problem with some unicode letter, e.g. ß
, as is found out by the test. It is recognised as SS
in Python3 test.
That is the correct behaviour so I didn't want to change it. Python2 was basically doing it in a wrong way. I always wondered why my street in Germany has two SS in many online services, now I know :smile:
Problem still exists with Python2 built Vim.
<LocalLeader>cn
and creating links gil
promptTraceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/plugins/EditCheckbox.py", line 44, in new
_checkbox
d = ORGMODE.get_document()
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/_vim.py", line 302, in get_document
self._documents[bufnr] = VimBuffer(bufnr).init_dom()
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/liborgmode/documents.py", line 146, in in
it_dom
h = self.find_heading(heading=heading)
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/liborgmode/documents.py", line 292, in fi
nd_heading
self._content[start:end + 1], self.get_all_todo_states(),
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/vimbuffer.py", line 399, in __getslice__
for item in MultiPurposeList.__getslice__(self, i, j)]
File "/Users/chong/.vim/plugged/vim-orgmode/ftplugin/orgmode/liborgmode/base.py", line 89, in __getsli
ce__
return UserList.__getitem__(self, slice(i, j))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/UserList.py", line 31, in
__getitem__
def __getitem__(self, i): return self.data[i]
TypeError: sequence index must be integer, not 'slice'
Agenda function is also undermined by that sequence index must be integer, not 'slice'
issue.
@Ron89 fixed.
Hey @akstrfn , would you mind send pull request with your non-master branch? So that we can be sure that all changes made in this PR are Python3 support relavant. If you send with general purpose master branch, and make some changes in the branch before we pulling it in, those unrelavant changes will be pulled in too.