Skip to content

Commit 0674289

Browse files
committed
Allow uris as input
--HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40444
1 parent 99a484f commit 0674289

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/inputstream.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ def openStream(self, source):
7979
return open(source)
8080
except: pass
8181

82+
# Try opening from the internet
83+
try:
84+
if source.startswith('http://'):
85+
import urllib
86+
source = urllib.urlopen(source).read()
87+
except: pass
88+
8289
# Otherwise treat source as a string and convert to a file object
8390
import cStringIO
8491
stream = cStringIO.StringIO(str(source))

0 commit comments

Comments
 (0)