コード例 #1
0
if __name__ == "__main__":
    # options and system configure
    parser = ArgumentParser(description='Initiate a TREMPPI project.')
    parser.add_argument('--path', help='specify the browsing location.')
    parser.add_argument('--port',
                        help='number of the port to run the browser on')
    parser.add_argument('--debug',
                        help='if set, run debug',
                        action='store_true')
    parser.add_argument('--nopen',
                        help='if set, do not open the browser',
                        action='store_true')
    parser.add_argument('--host',
                        help='set the host adderss',
                        default="localhost")

    args = parser.parse_args()
    system_init(argv[0], args)

    # Execute the server itself.
    if args.port is not None:
        port = args.port
    else:
        port = default_port

    # Start web server
    app = create_app()
    if args.nopen is False:
        webbrowser.open("http://localhost:" + port)
    app.run(port=int(port), debug=args.debug, host=args.host)
コード例 #2
0
ファイル: server.py プロジェクト: riplotus/TREMPPI
from tremppi.server_app import create_app
from tremppi.header import system_init, default_port, system, server_folder

if __name__ == "__main__":
    # options and system configure
    parser = argparse.ArgumentParser(description='Start a tremppi server.')
    parser.add_argument('--path', help='the path argument is ignored')
    parser.add_argument('--port',
                        help='number of the port to run the browser on')
    parser.add_argument('--debug', help='if set, run debug', default=False)
    parser.add_argument('--host',
                        help='set the host adderss',
                        default="localhost")

    args = parser.parse_args()
    system_init(sys.argv[0], args)

    # set the server to the fixed location
    system.DEST_PATH = os.path.join(system.HOME_PATH, server_folder)
    if not os.path.isdir(system.DEST_PATH):
        raise Exception('The server folder does not exist.')

    if args.port is not None:
        port = args.port
    else:
        port = default_port

    # Start the web server
    app = create_app()
    app.run(port=int(port), debug=args.debug, host=args.host)
コード例 #3
0
ファイル: init.py プロジェクト: xstreck1/TREMPPI
#
# This file is part of the Toolkit for Reverse Engineering of Molecular Pathways
# via Parameter Identification (TREMPPI)
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# this program.  If not, see <http://www.gnu.org/licenses/>.

import argparse
import sys

from tremppi.header import system_init, system
from tremppi.project_files import tremppi_init

if __name__ == "__main__":
    parser = argparse.ArgumentParser(description='Initiate a TREMPPI project.')
    parser.add_argument('--path', help='specify the location where the file gets created.')
    parser.add_argument('--server', help='informs the script that it is called from a server.', action='store_true')
    parser.add_argument('name', help='name of the newly created model')
    args = parser.parse_args()

    system_init(sys.argv[0], args)
    tremppi_init(system.DEST_PATH, args.name)