Skip to content

Commit

Permalink
fix #409
Browse files Browse the repository at this point in the history
  • Loading branch information
0u812 committed Oct 10, 2017
1 parent 7bdd977 commit 9c2e8b5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions wrappers/Python/roadrunner/roadrunner.i
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,25 @@ namespace std { class ostream{}; }
_swig_init = __init__
def _new_init(self, *args):
# if called with https, use Python for transport
if len(args) >= 1:
p = args[0]
if hasattr(p,'startswith') and p.startswith('https://'):
try:
# Python3
from urllib.request import urlopen
except ImportError:
# Python2
from urllib2 import urlopen
sbml = urlopen(p).read()
try:
sbml = str(sbml.decode())
except:
pass
RoadRunner._swig_init(self, sbml)
RoadRunner._makeProperties(self)
return
# Otherwise, use regular init
RoadRunner._swig_init(self, *args)
RoadRunner._makeProperties(self)

Expand Down

0 comments on commit 9c2e8b5

Please sign in to comment.