Makes pappy repeter work with python 3
This commit is contained in:
parent
864b1400b4
commit
201faa3eeb
2 changed files with 11 additions and 10 deletions
|
@ -11,9 +11,9 @@ import vim
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
from urlparse import urlparse, ParseResult, parse_qs
|
from urllib.parse import urlparse, ParseResult, parse_qs
|
||||||
from urllib import urlencode
|
from urllib.parse import urlencode
|
||||||
import Cookie as hcookies
|
import http.cookies as hcookies
|
||||||
|
|
||||||
## STRIPPED DOWN COPY OF HTTP OBJECTS / COMMS
|
## STRIPPED DOWN COPY OF HTTP OBJECTS / COMMS
|
||||||
|
|
||||||
|
@ -1449,6 +1449,7 @@ def parse_rsp_sline(sline):
|
||||||
return ResponseStatusLine(int(pmajor), int(pminor), int(status_code), reason.decode())
|
return ResponseStatusLine(int(pmajor), int(pminor), int(status_code), reason.decode())
|
||||||
|
|
||||||
def _parse_message(bs, sline_parser):
|
def _parse_message(bs, sline_parser):
|
||||||
|
bs = bs.encode()
|
||||||
header_env, body = re.split(b"\r?\n\r?\n", bs, 1)
|
header_env, body = re.split(b"\r?\n\r?\n", bs, 1)
|
||||||
status_line, header_bytes = re.split(b"\r?\n", header_env, 1)
|
status_line, header_bytes = re.split(b"\r?\n", header_env, 1)
|
||||||
h = Headers()
|
h = Headers()
|
||||||
|
@ -1502,7 +1503,7 @@ def run_command(command):
|
||||||
def set_buffer_content(buf, text):
|
def set_buffer_content(buf, text):
|
||||||
buf[:] = None
|
buf[:] = None
|
||||||
first = True
|
first = True
|
||||||
for l in text.split('\n'):
|
for l in text.split(b'\n'):
|
||||||
if first:
|
if first:
|
||||||
buf[0] = l
|
buf[0] = l
|
||||||
first = False
|
first = False
|
||||||
|
@ -1558,7 +1559,7 @@ def set_up_windows():
|
||||||
b1 = vim.current.buffer
|
b1 = vim.current.buffer
|
||||||
vim.command("let s:b1=bufnr('$')")
|
vim.command("let s:b1=bufnr('$')")
|
||||||
|
|
||||||
print msg_addr
|
print(msg_addr)
|
||||||
comm_type, comm_addr = msg_addr.split(":", 1)
|
comm_type, comm_addr = msg_addr.split(":", 1)
|
||||||
set_conn(comm_type, comm_addr)
|
set_conn(comm_type, comm_addr)
|
||||||
with ProxyConnection(kind=comm_type, addr=comm_addr) as conn:
|
with ProxyConnection(kind=comm_type, addr=comm_addr) as conn:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
if !has('python')
|
if !has('python3')
|
||||||
echo "Vim must support python in order to use the repeater"
|
echo "Vim must support python in order to use the repeater"
|
||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" Settings to make life easier
|
" Settings to make life easier
|
||||||
set hidden
|
set hidden
|
||||||
|
@ -9,7 +9,7 @@ set hidden
|
||||||
let s:pyscript = resolve(expand('<sfile>:p:h') . '/repeater.py')
|
let s:pyscript = resolve(expand('<sfile>:p:h') . '/repeater.py')
|
||||||
|
|
||||||
function! RepeaterAction(...)
|
function! RepeaterAction(...)
|
||||||
execute 'pyfile ' . s:pyscript
|
execute 'py3file ' . s:pyscript
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
command! -nargs=* RepeaterSetup call RepeaterAction('setup', <f-args>)
|
command! -nargs=* RepeaterSetup call RepeaterAction('setup', <f-args>)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue