diff options
author | Philipp Hagemeister <phihag@phihag.de> | 2012-11-26 04:05:54 +0100 |
---|---|---|
committer | Philipp Hagemeister <phihag@phihag.de> | 2012-11-26 04:05:54 +0100 |
commit | 51937c086943a3bdbf6f707c75d041ed3b0ba743 (patch) | |
tree | 99b85e93ace0b5342c39cbf63391832a1bc65d1b /youtube_dl/__init__.py | |
parent | 6b5076122246f8b7b43bac232b1da9a8dbdc2411 (diff) |
Add some parentheses around print for #180
Diffstat (limited to 'youtube_dl/__init__.py')
-rw-r--r-- | youtube_dl/__init__.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/youtube_dl/__init__.py b/youtube_dl/__init__.py index ee6de6237..bf4b55f48 100644 --- a/youtube_dl/__init__.py +++ b/youtube_dl/__init__.py @@ -48,7 +48,7 @@ from PostProcessor import * def updateSelf(downloader, filename): ''' Update the program file with the latest version from the repository ''' # Note: downloader only used for options - + if not os.access(filename, os.W_OK): sys.exit('ERROR: no write permissions on %s' % filename) @@ -66,7 +66,7 @@ def updateSelf(downloader, filename): directory = os.path.dirname(exe) if not os.access(directory, os.W_OK): sys.exit('ERROR: no write permissions on %s' % directory) - + try: urlh = urllib2.urlopen(UPDATE_URL_EXE) newcontent = urlh.read() @@ -75,20 +75,18 @@ def updateSelf(downloader, filename): outf.write(newcontent) except (IOError, OSError), err: sys.exit('ERROR: unable to download latest version') - + try: bat = os.path.join(directory, 'youtube-dl-updater.bat') b = open(bat, 'w') - - print >> b, """ + b.write(""" echo Updating youtube-dl... ping 127.0.0.1 -n 5 -w 1000 > NUL move /Y "%s.new" "%s" del "%s" - """ %(exe, exe, bat) - + \n""" %(exe, exe, bat)) b.close() - + os.startfile(bat) except (IOError, OSError), err: sys.exit('ERROR: unable to overwrite current version') |