Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(62)

Side by Side Diff: client/utils/oauth.py

Issue 2093593002: luci-py: Making __file__ usage unicode safe. (Closed) Base URL: https://github.com/luci/luci-py.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2013 The LUCI Authors. All rights reserved. 1 # Copyright 2013 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 """OAuth2 related utilities and implementation of browser based login flow.""" 5 """OAuth2 related utilities and implementation of browser based login flow."""
6 6
7 # pylint: disable=W0613 7 # pylint: disable=W0613
8 8
9 import base64 9 import base64
10 import BaseHTTPServer 10 import BaseHTTPServer
11 import collections 11 import collections
12 import datetime 12 import datetime
13 import json 13 import json
14 import logging 14 import logging
15 import optparse 15 import optparse
16 import os 16 import os
17 import socket 17 import socket
18 import sys 18 import sys
19 import threading 19 import threading
20 import time 20 import time
21 import urllib 21 import urllib
22 import urlparse 22 import urlparse
23 import webbrowser 23 import webbrowser
24 24
25 # All libraries here expect to find themselves in sys.path. 25 # All libraries here expect to find themselves in sys.path.
26 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) 26 ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(
27 __file__.decode(sys.getfilesystemencoding()))))
27 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party')) 28 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party'))
28 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pyasn1')) 29 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pyasn1'))
29 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'rsa')) 30 sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'rsa'))
30 31
31 import httplib2 32 import httplib2
32 import rsa 33 import rsa
33 34
34 from pyasn1.codec.der import decoder 35 from pyasn1.codec.der import decoder
35 from pyasn1.type import univ 36 from pyasn1.type import univ
36 37
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 self.end_headers() 593 self.end_headers()
593 query = self.path.split('?', 1)[-1] 594 query = self.path.split('?', 1)[-1]
594 query = dict(urlparse.parse_qsl(query)) 595 query = dict(urlparse.parse_qsl(query))
595 self.server.query_params = query 596 self.server.query_params = query
596 self.wfile.write('<html><head><title>Authentication Status</title></head>') 597 self.wfile.write('<html><head><title>Authentication Status</title></head>')
597 self.wfile.write('<body><p>The authentication flow has completed.</p>') 598 self.wfile.write('<body><p>The authentication flow has completed.</p>')
598 self.wfile.write('</body></html>') 599 self.wfile.write('</body></html>')
599 600
600 def log_message(self, _format, *args): 601 def log_message(self, _format, *args):
601 """Do not log messages to stdout while running as command line program.""" 602 """Do not log messages to stdout while running as command line program."""
OLDNEW
« no previous file with comments | « client/trace_inputs.py ('k') | client/utils/zip_package.py » ('j') | client/utils/zip_package.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698