From 13e18259a0ac7f5e09f3fb15b4e6f00845eb5338 Mon Sep 17 00:00:00 2001 From: Dan McDougall Date: Fri, 20 May 2016 19:07:41 -0400 Subject: [PATCH] Fixed some Python3-related bugs introduced by a pull request a while back. --- gateone/__init__.py | 2 +- gateone/auth/authentication.py | 16 ++++++++-------- gateone/core/server.py | 2 +- gateone/static/gateone.js | 2 +- terminal/terminal.py | 10 ++++------ 5 files changed, 15 insertions(+), 17 deletions(-) diff --git a/gateone/__init__.py b/gateone/__init__.py index d76578f8..a820c509 100644 --- a/gateone/__init__.py +++ b/gateone/__init__.py @@ -3,7 +3,7 @@ __version_info__ = (1, 2, 0) __license__ = "AGPLv3" # ...or proprietary (see LICENSE.txt) __author__ = 'Dan McDougall ' -__commit__ = "20151116212858" # Gets replaced by git (holds the date/time) +__commit__ = "20151122132622" # Gets replaced by git (holds the date/time) import os GATEONE_DIR = os.path.dirname(os.path.abspath(__file__)) diff --git a/gateone/auth/authentication.py b/gateone/auth/authentication.py index 9b702c7a..292580eb 100644 --- a/gateone/auth/authentication.py +++ b/gateone/auth/authentication.py @@ -606,7 +606,7 @@ def get(self): url_prefix=self.settings['url_prefix']) check = self.get_argument("check", None) if check: - self.set_header ('Access-Control-Allow-Origin', '*') + self.set_header('Access-Control-Allow-Origin', '*') user = self.get_current_user() if user: logging.debug('CASAuthHandler: user is authenticated') @@ -645,9 +645,9 @@ def authenticate_redirect(self, callback=None): cas_server += '/' service_url = "%sauth" % self.base_url next_url = self.get_argument('next', None) - next_param = "" - if next_url: - next_param = "?next=" + quote(next_url) + next_param = "" + if next_url: + next_param = "?next=" + quote(next_url) redirect_url = '%slogin?service=%s%s' % (cas_server, quote(service_url), quote(next_param)) logging.debug("Redirecting to CAS URL: %s" % redirect_url) self.redirect(redirect_url) @@ -671,15 +671,15 @@ def get_authenticated_user(self, server_ticket): if cas_version == 1: validate_suffix = 'validate' next_url = self.get_argument('next', None) - next_param = "" - if next_url: - next_param = "?next=" + quote(next_url) + next_param = "" + if next_url: + next_param = "?next=" + quote(next_url) validate_url = ( cas_server + validate_suffix + '?service=' + quote(service_url) + - quote(next_param) + + quote(next_param) + '&ticket=' + quote(server_ticket) ) diff --git a/gateone/core/server.py b/gateone/core/server.py index 09303b5a..617b2269 100755 --- a/gateone/core/server.py +++ b/gateone/core/server.py @@ -19,7 +19,7 @@ } } __author__ = 'Dan McDougall ' -__commit__ = "20151116212858" # Gets replaced by git (holds the date/time) +__commit__ = "20151122132622" # Gets replaced by git (holds the date/time) # NOTE: Docstring includes reStructuredText markup for use with Sphinx. __doc__ = '''\ diff --git a/gateone/static/gateone.js b/gateone/static/gateone.js index 2ecb9bc0..6a9e25e5 100644 --- a/gateone/static/gateone.js +++ b/gateone/static/gateone.js @@ -82,7 +82,7 @@ The base object for all Gate One modules/plugins. */ GateOne.__name__ = "GateOne"; GateOne.__version__ = "1.2"; -GateOne.__commit__ = "20151116212858"; +GateOne.__commit__ = "20151122132622"; GateOne.__repr__ = function () { return "[" + this.__name__ + " " + this.__version__ + "]"; }; diff --git a/terminal/terminal.py b/terminal/terminal.py index 0ed4174d..2ccac5d1 100644 --- a/terminal/terminal.py +++ b/terminal/terminal.py @@ -164,11 +164,6 @@ logging.error( "...or download it from http://pypi.python.org/pypi/ordereddict") sys.exit(1) -try: - from itertools import imap, izip -except ImportError: # Python 3 doesn't have imap or izip in itertool - imap = map - izip = zip try: xrange = xrange except NameError: # Python 3 doesn't have xrange() @@ -3716,7 +3711,10 @@ def cursor_position(self, coordinates): :coordinates: Should be something like, 'row;col' (1-based) but, 'row', 'row;', and ';col' are also valid (assumes 1 on missing value). - .. note:: If coordinates is '' (an empty string), the cursor will be moved to the top left (1;1). + .. note:: + + If coordinates is '' (an empty string), the cursor will be moved to + the top left (1;1). """ # NOTE: Since this is 1-based we have to subtract 1 from everything to # match how we store these values internally.