Skip to content
Open
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
10 changes: 6 additions & 4 deletions jupyter-zeppelin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import nbformat
import codecs
from aws.s3 import S3
from StringIO import StringIO
try:
from StringIO import StringIO
except:
from io import StringIO

MD = re.compile(r'%md\s')
SQL = re.compile(r'%sql\s')
Expand Down Expand Up @@ -172,14 +175,13 @@ def write_notebook(notebook_name, notebook, path=None):

zeppelin_note_path = None
target_path = None
if num_args == 2:
if num_args >= 2:
zeppelin_note_path = sys.argv[1]
elif num_args == 3:
if num_args == 3:
target_path = sys.argv[2]

if not zeppelin_note_path:
exit()

name, content = convert_json(read_io(zeppelin_note_path))
write_notebook(name, content, target_path)