environment.py revision f2477e01787aa58f445919b809d89e252beef54f
1# Copyright 2013 The Chromium Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5import os 6import sys 7 8 9def _IsServerSoftware(name): 10 return os.environ.get('SERVER_SOFTWARE', '').find(name) == 0 11 12 13def IsDevServer(): 14 return _IsServerSoftware('Development') 15 16 17def IsReleaseServer(): 18 return _IsServerSoftware('Google App Engine') 19 20 21def IsPreviewServer(): 22 return sys.argv and os.path.basename(sys.argv[0]) == 'preview.py' 23