Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
except: pass
def copy(input, name, buffer_size = 16384):
output = open(name, "wb")
try:
while True:
data = input.read(buffer_size)
if not data: break
output.write(data)
finally:
output.close()
def is_tty():
return hasattr(sys.stdout, "isatty") and sys.stdout.isatty()
contents, _response = appier.get(
url,
handle = True,
redirect = True,
retry = 0,
use_file = True,
callback_headers = callback_headers,
callback_data = callback_data,
callback_result = callback_result
)
try: copy(contents, name)
finally: contents.close()
__revision__ = "$LastChangedRevision$"
""" The revision number of the module """
__date__ = "$LastChangedDate$"
""" The last change date of the module """
__copyright__ = "Copyright (c) 2008-2018 Hive Solutions Lda."
""" The copyright for the module """
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import appier
_contents, response = appier.get("https://www.flickr.com/", handle = True)
print(response.getcode())
print(response.read())
__license__ = "Apache License, Version 2.0"
""" The license for the module """
import appier
def callback(result, response):
if response:
print(response.getcode())
print(response.read())
else:
print("Problem in connection")
loop.stop()
loop, protocol = appier.get(
"https://www.flickr.com/",
handle = True,
asynchronous = True,
callback = callback
)
loop.run_forever()
loop.close()