summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/docs/server2/environment.py
blob: 7433be3ad29b639a5b0257d92e9f831550e509cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import os
import sys


def _IsServerSoftware(name):
  return os.environ.get('SERVER_SOFTWARE', '').find(name) == 0


def IsDevServer():
  return _IsServerSoftware('Development')


def IsReleaseServer():
  return _IsServerSoftware('Google App Engine')


def IsPreviewServer():
  return sys.argv and os.path.basename(sys.argv[0]) == 'preview.py'