示例#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()