コード例 #1
0
ファイル: startup.py プロジェクト: jelford/reef
def setupServer():
    """
    Set up the server and print relevant information.

    This should be called after the config is set up. It gets and sets config
    values.

    """

    import myserver
    import authentication

    myserver.getServer().setup()

    print "Now you can log on to the server with the following credentials:"
    print ""
    print "Location: http://localhost:" + str(config.getSettings("server")["port"])

    if authentication.active():
        print "User: "******"Password: <You should know>"
        print ""
        print "If I displayed the password back to you then the small amount of security during the input would be wasted."
        print "(You can just read it in the config file though, that's a problem.)"
コード例 #2
0
ファイル: startup.py プロジェクト: OhBaby/reef
        authentication.addUser(pb.app_user, password)
    else:
        authentication.clear()

    show_break()

# Start server

import myserver

myserver.getServer().setup()

print "Now you can log on to the server with the following credentials:"
print ""
print "Location: http://localhost:" + str(config.getSettings("server")["port"])
if authentication.active():
    print "User: "******"Password: <You should know>"
print ""
print "If I displayed the password back to you then the small amount of security during the input would be wasted."
print "(You can just read it in the config file though, that's a problem.)"

show_break()

config.saveConfig()
print "Config written to disk"

# Set automatic save on close
atexit.register(config.saveConfig)

show_break()