Skip to content

Commit

Permalink
Import print_function for ST2 compatibility
Browse files Browse the repository at this point in the history
Fixes bug that caused the Open Ipython Notebook command to not show up on ST2
  • Loading branch information
sloria committed Sep 21, 2013
1 parent c4280fc commit 0625aae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ipy_connection.py
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2013, Maxim Grechkin
# This file is licensed under GNU General Public License version 3
# See COPYING for details.

from __future__ import print_function
import json
import uuid

Expand Down
10 changes: 5 additions & 5 deletions ipy_view.py
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2013, Maxim Grechkin
# This file is licensed under GNU General Public License version 3
# See COPYING for details.

from __future__ import print_function
import sublime
try:
from SublimeIPythonNotebook import ipy_connection
Expand Down Expand Up @@ -210,7 +210,7 @@ def rewrite_prompt_number(self, edit):
out_reg = self.get_region("inb_output")
line = self.view.line(out_reg.begin() - 1)
self.view.replace(edit, line, "#Output[%s]" % self.prompt)



def output_result(self, edit):
Expand Down Expand Up @@ -461,7 +461,7 @@ def render_notebook(self, edit):

for cell in self.cells:
cell.draw(edit)

if len(self.cells) > 0:
self.cells[0].select()

Expand Down Expand Up @@ -492,7 +492,7 @@ def handle_completions(self, view, prefix, locations):
row, col = view.rowcol(sel.begin())
compl = self.kernel.get_completitions(line, col, timeout=0.7)


if len(compl) > 0:
def get_last_word(s): # needed for file/directory completion
if s.endswith("/"):
Expand Down Expand Up @@ -668,4 +668,4 @@ def on_close(self, view):
if id in self.views:
del self.views[id]

manager = NotebookViewManager()
manager = NotebookViewManager()
4 changes: 2 additions & 2 deletions subl_ipy_notebook.py
Expand Up @@ -2,7 +2,7 @@
# Copyright (c) 2013, Maxim Grechkin
# This file is licensed under GNU General Public License version 3
# See COPYING for details.

from __future__ import print_function
import sublime
import sublime_plugin
try:
Expand Down Expand Up @@ -43,7 +43,7 @@ def run(self, baseurl):
self.baseurl = baseurl
nbs = ipy_connection.get_notebooks(baseurl)
if nbs is None:
print ("Cannot get a list of notebooks")
print("Cannot get a list of notebooks")
return
self.nbs = nbs
lst = ["0: Create New Notebook\n"]
Expand Down

0 comments on commit 0625aae

Please sign in to comment.