1 | #!/usr/bin/env python
|
---|
2 | # -*- coding: utf-8 -*-
|
---|
3 | # $Id: index.py 76553 2019-01-01 01:45:53Z vboxsync $
|
---|
4 |
|
---|
5 | """
|
---|
6 | CGI - Web UI - Main (index) page.
|
---|
7 | """
|
---|
8 |
|
---|
9 | __copyright__ = \
|
---|
10 | """
|
---|
11 | Copyright (C) 2012-2019 Oracle Corporation
|
---|
12 |
|
---|
13 | This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | available from http://www.virtualbox.org. This file is free software;
|
---|
15 | you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | General Public License (GPL) as published by the Free Software
|
---|
17 | Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
18 | VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
19 | hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 |
|
---|
21 | The contents of this file may alternatively be used under the terms
|
---|
22 | of the Common Development and Distribution License Version 1.0
|
---|
23 | (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
24 | VirtualBox OSE distribution, in which case the provisions of the
|
---|
25 | CDDL are applicable instead of those of the GPL.
|
---|
26 |
|
---|
27 | You may elect to license modified versions of this file under the
|
---|
28 | terms and conditions of either the GPL or the CDDL or both.
|
---|
29 | """
|
---|
30 | __version__ = "$Revision: 76553 $"
|
---|
31 |
|
---|
32 |
|
---|
33 | # Standard python imports.
|
---|
34 | import os
|
---|
35 | import sys
|
---|
36 |
|
---|
37 | # Only the main script needs to modify the path.
|
---|
38 | g_ksValidationKitDir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))));
|
---|
39 | sys.path.append(g_ksValidationKitDir);
|
---|
40 |
|
---|
41 | # Validation Kit imports.
|
---|
42 | from testmanager import config;
|
---|
43 | from testmanager.core.webservergluecgi import WebServerGlueCgi;
|
---|
44 | from testmanager.webui.wuimain import WuiMain;
|
---|
45 |
|
---|
46 |
|
---|
47 | def main():
|
---|
48 | """
|
---|
49 | Main function a la C/C++. Returns exit code.
|
---|
50 | """
|
---|
51 |
|
---|
52 | oSrvGlue = WebServerGlueCgi(g_ksValidationKitDir, fHtmlOutput = False);
|
---|
53 | try:
|
---|
54 | oWui = WuiMain(oSrvGlue);
|
---|
55 | oWui.dispatchRequest();
|
---|
56 | oSrvGlue.flush();
|
---|
57 | except Exception as oXcpt:
|
---|
58 | return oSrvGlue.errorPage('Internal error: %s' % (str(oXcpt),), sys.exc_info());
|
---|
59 |
|
---|
60 | return 0;
|
---|
61 |
|
---|
62 | if __name__ == '__main__':
|
---|
63 | if config.g_kfProfileIndex:
|
---|
64 | from testmanager.debug import cgiprofiling;
|
---|
65 | sys.exit(cgiprofiling.profileIt(main));
|
---|
66 | else:
|
---|
67 | sys.exit(main());
|
---|
68 |
|
---|