File: remote_server_assign_variable.py

package info (click to toggle)
gnat-gps 4.3-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 49,096 kB
  • ctags: 20,461
  • sloc: ada: 274,120; ansic: 154,849; python: 9,890; tcl: 9,812; sh: 8,192; xml: 7,970; cpp: 4,737; yacc: 3,520; makefile: 2,136; lex: 2,043; java: 1,638; perl: 302; awk: 265; sed: 161; asm: 14; fortran: 2; lisp: 1
file content (13 lines) | stat: -rw-r--r-- 480 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
# This script automatically assigns the scenario variable "target" upon
# assignment of the build server.

my_linux_server_nickname="foo"

def server_changed (hook, server_type, nickname):
    if server_type == "BUILD_SERVER":
       if nickname == "my_linux_server_nickname":
          GPS.Project.set_scenario_variable ("target", "Linux-remote")
       else:
          GPS.Project.set_scenario_variable ("target", "Windows")

GPS.Hook ("server_config_hook").add (server_changed)