Skip to content
Open
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
10 changes: 5 additions & 5 deletions charts/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

__version__ = '0.4.6'

from plot import plot, plotasync, line, area, spline, pie
from server import run_server
from .plot import plot, plotasync, line, area, spline, pie
from .server import run_server

from IPython.core import getipython
from IPython.core.display import display, HTML

from settings import default_settings, default_options, load_options
import data
import jsonencoder
from .settings import default_settings, default_options, load_options
import charts.data
import charts.jsonencoder
2 changes: 1 addition & 1 deletion charts/chart.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__author__ = 'arnoutaertgeerts'


from core import to_series, to_json_files, show_plot, set_display
from .core import to_series, to_json_files, show_plot, set_display


class Chart():
Expand Down
8 changes: 4 additions & 4 deletions charts/core.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
__author__ = 'arnoutaertgeerts'

from string import Template
from jsonencoder import ChartsJSONEncoder
from server import url
from .jsonencoder import ChartsJSONEncoder
from .server import url

import os
import json
Expand All @@ -22,15 +22,15 @@ def show_plot(html, saveHTML, show, async=False):
return HTML(html)

elif show == 'tab':
print 'Opening new tab...'
print('Opening new tab...')
if async:
address = url(async)
webbrowser.open_new_tab(address)
else:
webbrowser.open_new_tab('file://' + os.path.realpath(saveHTML))

elif show == 'window':
print 'Trying to open a window. If this fails we will open a tab...'
print('Trying to open a window. If this fails we will open a tab...')
if async:
address = url(async)
webbrowser.open_new(address)
Expand Down
4 changes: 2 additions & 2 deletions charts/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def df_to_series(df, display=[]):
display[col]
display[col]=True
except KeyError:
print 'Warning\n','-'*7,'\n',' '*4,'"{}"'.format(col), 'will not be displayed.\nVariable not found in DataFrame.\n'
print 'Try one the following columns:\n{}'.format(list(df.columns))
print('Warning\n','-'*7,'\n',' '*4,'"{}"'.format(col), 'will not be displayed.\nVariable not found in DataFrame.\n')
print('Try one the following columns:\n{}'.format(list(df.columns)))
except TypeError:
display = dict(zip(df.columns,[plot_columns for x in df]))
for col in df:
Expand Down
10 changes: 5 additions & 5 deletions charts/plot.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
__author__ = 'Arnout Aertgeerts'

from core import MyTemplate, to_json_files, to_series, clean_dir, set_display, show_plot, make_dir, remove_quotes
from jsonencoder import ChartsJSONEncoder
from chart import Chart
from server import address
from settings import default_settings, load_options, default_options
from .core import MyTemplate, to_json_files, to_series, clean_dir, set_display, show_plot, make_dir, remove_quotes
from .jsonencoder import ChartsJSONEncoder
from .chart import Chart
from .server import address
from .settings import default_settings, load_options, default_options

import os
import json
Expand Down
11 changes: 8 additions & 3 deletions charts/server.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
__author__ = 'Arnout Aertgeerts'

import SimpleHTTPServer
import SocketServer
import sys
if sys.version_info.major == 3:
import http.server as SimpleHTTPServer
import socketserver as SocketServer
else:
import SimpleHTTPServer
import SocketServer
import os
import json

Expand Down Expand Up @@ -42,7 +47,7 @@ def run_server():
server = ChartServer(address, ChartRequestHandler)
ip, port = server.server_address # find out what port we were given

print 'Server running in the folder {0} at {1}:{2}'.format(os.path.abspath(os.getcwd()), ip, port)
print('Server running in the folder {0} at {1}:{2}'.format(os.path.abspath(os.getcwd()), ip, port))

t = threading.Thread(target=server.serve_forever)
t.setDaemon(True) # don't hang on exit
Expand Down
2 changes: 1 addition & 1 deletion charts/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ def load_options(path):
with open(path, 'r') as json_file:
return json.loads(json_file.read())
except IOError:
print 'No options file found. Did you spell the name correctly?'
print('No options file found. Did you spell the name correctly?')
return dict()