tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

browser.py (625B)


      1 from .. import lib
      2 
      3 try:
      4     from youtube_upload.auth import webkit_qt as backend
      5     WEBKIT_BACKEND = "qt"
      6 except ImportError:
      7     try:
      8         from youtube_upload.auth import webkit_gtk as backend
      9         WEBKIT_BACKEND = "gtk"
     10     except ImportError:
     11         WEBKIT_BACKEND = None
     12 
     13 def get_code(url, size=(640, 480), title="Google authentication"):
     14     if WEBKIT_BACKEND:
     15         lib.debug("Using webkit backend: " + WEBKIT_BACKEND)
     16         with lib.default_sigint():
     17             return backend.get_code(url, size=size, title=title)
     18     else:
     19         raise NotImplementedError("GUI auth requires pywebkitgtk or qtwebkit")