예제 #1
0
    name = sys.argv[sys.argv.index("--mode") + 1]

    lang = getInterpreter(name)

else:

    lang = FOXDOT

if "-p" in sys.argv or "--public" in sys.argv:

    host, port = PUBLIC_SERVER_ADDRESS

elif os.path.isfile('client.cfg'):

    host, port = Client.read_configuration_file('client.cfg')
    """
    You can set a configuration file if you are connecting to the same
    server on repeated occasions. A password should not be stored. The
    file (client.cfg) should look like:

    host=<host_ip>
    port=<port_no>

    """

else:

    host = readin("Troop Server Address", default="localhost")
    port = readin("Port Number", default="57890")
예제 #2
0
    options['password'] = getpass()
    options['get_info'] = False  # Flag to say we don't need the GUI

elif args.config:

    import os.path

    if os.path.isfile('client.cfg'):
        """
        You can set a configuration file if you are connecting to the same
        server on repeated occasions. A password should not be stored. The
        file (client.cfg) should look like:

        host=<host_ip>
        port=<port_no>

        """

        options.update(Client.read_configuration_file('client.cfg'))

    else:

        print("Unable to load configuration from 'client.cfg'")

# Store any extra arguments to supply to the interpreter

if args.args:

    options['args'] = args.args

myClient = Client(**options)
예제 #3
0
    options['get_info'] = False  # Flag to say we don't need the GUI

elif args.config:

    import os.path

    if os.path.isfile('client.cfg'):
        """
        You can set a configuration file if you are connecting to the same
        server on repeated occasions. A password should not be stored. The
        file (client.cfg) should look like:

        host=<host_ip>
        port=<port_no>

        """

        options['host'], options['port'] = Client.read_configuration_file(
            'client.cfg')

    else:

        print("Unable to load configuration from 'client.cfg'")

# Store any extra arguments to supply to the interpreter

if args.args:

    options['args'] = args.args

myClient = Client(**options)