Skip to content

Commit

Permalink
doc: corrected exaample details
Browse files Browse the repository at this point in the history
  • Loading branch information
Zen-CODE committed Apr 24, 2016
1 parent bf5a71a commit 6157496
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions examples/background_transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def download_file(self, url):
@protocol('NSURLSessionDownloadDelegate')
def URLSession_downloadTask_didWriteData_totalBytesWritten_totalBytesExpectedToWrite_(self, *args):
Logger.info(
"main.y: Protocol method "
"background_transfer.py: Protocol method "
"URLSession_downloadTask_didWriteData_totalBytesWritten_"
"totalBytesExpectedToWrite_ with {0}".format(args))

@protocol('NSURLSessionDownloadDelegate')
def URLSession_downloadTask_didFinishDownloadingToURL_(self, *args):
Logger.info(
"main.py: Protocol method "
"background_transfer.py: Protocol method "
"URLSession_downloadTask_didFinishDownloadingToURL_ "
"with {0}".format(args))
if len(args) > 2:
Expand All @@ -84,7 +84,7 @@ def URLSession_downloadTask_didFinishDownloadingToURL_(self, *args):
def URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_(self,
*args):
Logger.info(
"main.py: Protocol method "
"background_transfer.py: Protocol method "
"URLSession_downloadTask_didResumeAtOffset_expectedTotalBytes_"
" with {0}".format(args))

Expand All @@ -95,13 +95,16 @@ def URLSession_task_didCompleteWithError_(self, *args):
delegate catches errors preventing the main delegate from functioning.
"""
Logger.info(
"main.py: Protocol method URLSession_task_didCompleteWithError_"
"background_transfer.py: Protocol method "
"URLSession_task_didCompleteWithError_"
"with {0}".format(args))

if len(args) > 2:
ns_err = args[2]
if ns_err is not None:
Logger.info('Error {}'.format(ns_err.description().cString()))
Logger.info('background_transfer: Error {}'.format(
ns_err.description().cString()))

if __name__ == '__main__':
TestApp(bg_transfer=BackgroundTransfer()).run()

0 comments on commit 6157496

Please sign in to comment.