Move imports to top (Closes #283)
authorPhilipp Hagemeister <phihag@phihag.de>
Sun, 26 Feb 2012 22:53:56 +0000 (23:53 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Sun, 26 Feb 2012 22:53:56 +0000 (23:53 +0100)
youtube_dl/__init__.py

index ffd837c3237da91e2461a00cde0f8e8753acc7bd..ef48b7ecb6babd83ff1f2ae0f1025e87f4375c0f 100755 (executable)
@@ -22,8 +22,10 @@ __version__ = '2012.01.08b'
 
 UPDATE_URL = 'https://raw.github.com/rg3/youtube-dl/master/youtube-dl'
 
+
 import cookielib
 import datetime
+import getpass
 import gzip
 import htmlentitydefs
 import HTMLParser
@@ -31,9 +33,11 @@ import httplib
 import locale
 import math
 import netrc
+import optparse
 import os
 import os.path
 import re
+import shlex
 import socket
 import string
 import subprocess
@@ -4205,11 +4209,6 @@ def updateSelf(downloader, filename):
        downloader.to_screen(u'Updated youtube-dl. Restart youtube-dl to use the new version.')
 
 def parseOpts():
-       # Deferred imports
-       import getpass
-       import optparse
-       import shlex
-
        def _readOptions(filename_bytes):
                try:
                        optionf = open(filename_bytes)