742N/A## -*- coding: utf-8 -*-
742N/A##
742N/A## CDDL HEADER START
742N/A##
742N/A## The contents of this file are subject to the terms of the
742N/A## Common Development and Distribution License (the "License").
742N/A## You may not use this file except in compliance with the License.
742N/A##
742N/A## You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
742N/A## or http://www.opensolaris.org/os/licensing.
742N/A## See the License for the specific language governing permissions
742N/A## and limitations under the License.
742N/A##
742N/A## When distributing Covered Code, include this CDDL HEADER in each
742N/A## file and include the License file at usr/src/OPENSOLARIS.LICENSE.
742N/A## If applicable, add the following below this CDDL HEADER, with the
742N/A## fields enclosed by brackets "[]" replaced with your own identifying
742N/A## information: Portions Copyright [yyyy] [name of copyright owner]
742N/A##
742N/A## CDDL HEADER END
742N/A##
2186N/A## Copyright 2008, 2010 Oracle and/or its affiliates. All rights reserved.
742N/A##
742N/A<%!
742N/A import re
3234N/A from six.moves.urllib.parse import urlparse
742N/A%>\
742N/A<%page args="g_vars"/>\
742N/A## Please note that the opensolaris.org and sun.com themes can not be used
742N/A## unless authorized by Sun Microsystems, Inc.
742N/A<%
742N/A web_config = g_vars["web_config"]
742N/A
742N/A # Specify the name of a theme to use below. The value specified should
742N/A # be the name of a directory found in the _themes directory. If no
742N/A # value is provided, an attempt to determine an appropriate theme will
742N/A # be made.
742N/A web_config["theme"] = ""
742N/A%>\
742N/A## Nothing below this line should normally be changed.
742N/A<%
742N/A request = g_vars["request"]
742N/A if not web_config["theme"]:
742N/A # If a theme was not specified, attempt to determine which theme
742N/A # to use based on an absolute URL to the current server.
742N/A scheme, netloc, path, params, query, fragment = \
3234N/A urlparse(request.url(), allow_fragments=0)
742N/A
2186N/A match = re.match("(?:.*[.])?(opensolaris.(?:com|org)|sun.com|oracle.com)", netloc)
742N/A if match:
742N/A web_config["theme"] = match.group(1)
742N/A else:
742N/A web_config["theme"] = "default"
742N/A%>\