Skip to content

Commit

Permalink
examples in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Jan 18, 2024
1 parent 7cbec22 commit a3c4c8c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions examples/fetchurl.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ def isproxyalive(proxy):

def main():
if len(sys.argv) != 3:
print 'Not enough arguments'
print 'Usage:\n%s <pacfile> <url>' % sys.argv[0]
print('Not enough arguments')
print('Usage:\n%s <pacfile> <url>' % sys.argv[0])
return None
pacfile = sys.argv[1]
url = sys.argv[2]
response = fetch_url_using_pac(pacfile, url)
if response:
print response.read()
print(response.read())
else:
sys.stderr.write('URL %s could not be retrieved using PAC file %s.' %
(url, pacfile))
Expand Down
6 changes: 3 additions & 3 deletions examples/pactest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/python2.5
#!/usr/bin/python

import pacparser

pacparser.init()
pacparser.parse_pac("wpad.dat")
proxy = pacparser.find_proxy("http://www.manugarg.com")
print proxy
print(proxy)
pacparser.cleanup()

# Or simply,
print pacparser.just_find_proxy("wpad.dat", "http://www2.manugarg.com")
print(pacparser.just_find_proxy("wpad.dat", "http://www2.manugarg.com"))

0 comments on commit a3c4c8c

Please sign in to comment.