Skip to content

Revamp streaming #253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
adjust imports to not cater to python 2.6!
  • Loading branch information
theengineear committed Jul 7, 2015
commit 4afa886480c316885a52d3d1f4e53d128a5b58fc
8 changes: 1 addition & 7 deletions plotly/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@


"""
import sys
import six

if sys.version[:3] == '2.6':
import simplejson as json
else:
import json
import json

## Base Plotly Error ##

Expand Down
7 changes: 1 addition & 6 deletions plotly/graph_objs/graph_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from __future__ import absolute_import

import warnings
from collections import OrderedDict
import six
from plotly.graph_objs import graph_objs_tools
from plotly.graph_objs.graph_objs_tools import (
Expand All @@ -35,12 +36,6 @@
from plotly import utils

import copy
import sys
if sys.version[:3] == '2.6':
from ordereddict import OrderedDict
else:
from collections import OrderedDict

__all__ = None


Expand Down
17 changes: 2 additions & 15 deletions plotly/graph_objs/graph_objs_tools.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
from __future__ import absolute_import
from plotly import utils
import textwrap
import json
import os
import sys
if sys.version[:3] == '2.6':
try:
from ordereddict import OrderedDict
import simplejson as json
except ImportError:
raise ImportError(
"Looks like you're running Python 2.6. Plotly expects newer "
"standard library versions of ordereddict and json. You can "
"simply upgrade with these 'extras' with the following terminal "
"command:\npip install 'plotly[PY2.6]'"
)
else:
from collections import OrderedDict
import json
from collections import OrderedDict
import six

from pkg_resources import resource_string
Expand Down
6 changes: 1 addition & 5 deletions plotly/grid_objs/grid_objs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
"""
from __future__ import absolute_import

import sys
import json
from collections import MutableSequence
from plotly import exceptions
from plotly import utils

if sys.version[:3] == '2.6':
import simplejson as json
else:
import json

__all__ = None

Expand Down
5 changes: 1 addition & 4 deletions plotly/plotly/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import sys
import warnings
import copy
import json
import os
import six
import base64
Expand All @@ -29,10 +30,6 @@
else:
from urllib.parse import urlparse

if sys.version[:3] == '2.6':
import simplejson as json
else:
import json

from plotly.plotly import chunked_requests
from plotly import utils
Expand Down
6 changes: 1 addition & 5 deletions plotly/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

"""

import json
import os.path
import sys
import threading
Expand All @@ -31,11 +32,6 @@
except ImportError:
_sage_imported = False

if sys.version[:3] == '2.6':
import simplejson as json
else:
import json


### incase people are using threading, we lock file reads
lock = threading.Lock()
Expand Down
7 changes: 1 addition & 6 deletions plotly/widgets/graph_widget.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from collections import deque
import json
import uuid
import sys

# TODO: protected imports?
from IPython.html import widgets
Expand All @@ -12,11 +12,6 @@
from plotly.graph_objs import Figure
from pkg_resources import resource_string

# even though python 2.6 wouldn't be able to run *any* of this...
if sys.version[:3] == '2.6':
import simplejson as json
else:
import json

# Load JS widget code
# No officially recommended way to do this in any other way
Expand Down