Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pythonx/vdebug/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,12 @@ def run(self, status):
if str(status) == "interactive":
self.ui.error("Debugger engine says it is in interactive mode,"
"which is not supported: closing connection")
#self.__breakpoints.unlink_api()
log.Log("closing connection because of interactive mode")
self.session.close_connection()
elif str(status) in ("stopping", "stopped"):
self.ui.set_status("stopped")
self.ui.say("Debugging session has ended")
#self.__breakpoints.unlink_api()
log.Log("closing connection because status is stopped")
self.session.close_connection(False)
if opts.Options.get('continuous_mode', int) != 0:
self.dispatch("listen")
Expand Down
21 changes: 12 additions & 9 deletions pythonx/vdebug/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import sys
import time
import traceback
import codecs
try:
import urllib.parse as urllib
except ImportError:
Expand Down Expand Up @@ -49,7 +50,9 @@ def handle_interrupt(self):
def handle_socket_end(self):
"""Handle a socket closing, which is pretty normal.
"""
self._session_handler.ui().say("Connection to the debugger has been closed")
self._session_handler.ui().say(
"Connection to the debugger has been closed"
)
self._session_handler.stop()

def handle_vim_error(self, e):
Expand Down Expand Up @@ -84,7 +87,7 @@ def handle(self, e):
elif isinstance(e, error.UserInterrupt):
try:
self.handle_interrupt()
except:
except Exception as e:
pass
elif isinstance(e, self.readable_errors):
self.handle_readable_error(e)
Expand All @@ -96,12 +99,10 @@ def handle(self, e):
print("Keyboard interrupt - debugging session cancelled")
try:
self._session_handler.stop()
except:
except Exception as e:
pass
else:
self.handle_general_exception()
#elif isinstance(e,vim.error):
# self.handle_vim_error(e)


class Keymapper:
Expand Down Expand Up @@ -137,7 +138,6 @@ def map(self):

def reload(self):
self.is_mapped = False
self._reload_keys()
self.map()

def _reload_keys(self):
Expand All @@ -153,7 +153,8 @@ def _store_old_map(self):
keys = {v for k, v in self.keymaps.items() if k not in self.exclude}
special = {"<buffer>", "<silent>", "<special>", "<script>", "<expr>",
"<unique>"}
for line in open(tempfile, 'r'):
for line in codecs.open(tempfile, 'r', 'cp1250'):
line = line.encode('utf-8').decode('utf-8')
if not regex.match(line):
continue
parts = split_regex.split(line)[1:]
Expand Down Expand Up @@ -258,7 +259,9 @@ def _create_remote(f):
elif remote.endswith('/') and not local.endswith('/'):
remote = remote[:-1]
ret = ret.replace(local, remote, 1)
# replace remaining local separators with URL '/' separators
"""
replace remaining local separators with URL '/' separators
"""
ret = ret.replace('\\', '/')
break

Expand Down Expand Up @@ -349,5 +352,5 @@ def probe():
try:
vim.eval("getchar(0)")
time.sleep(0.1)
except: # vim.error
except vim.error as e:
raise error.UserInterrupt()