Did I find the right examples for you? yes no

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/a/d/AdminCraft-HEAD/admincraft/views.py   AdminCraft(Download)
 
    #Open and read -10 lines from the server.log file into object. Used to get last line for activeUsers below.
    loggingFile = config.MINECRAFTDIR + config.SERVERLOG
    loggingFile = open(loggingFile, "r")
    logging = loggingFile.readlines()[-10:]
def showLog():
    loggingFile = config.MINECRAFTDIR + config.SERVERLOG
    loggingFile = open(loggingFile, "r")
    loggingHTML = loggingFile.readlines()
 
def sendCommand():
    #server.log file for logging command entered
    loggingFile = config.MINECRAFTDIR + config.SERVERLOG
    now = datetime.datetime.now()
    time = now.strftime("%Y-%m-%d %H:%M:%S")
def logs():
 
    #Open and read last 40 lines. This needs to be configurable eventually.
    loggingFile = config.MINECRAFTDIR + config.SERVERLOG
    loggingFile = open(loggingFile, "r")
    subprocess.Popen(config.MINECRAFTDAEMON + ' command list', shell=True)
    sleep(1) #Unfortunately, the minecraft init commands lag a bit, so this is required to grab the last line correctly.
    activeUsersFile = config.MINECRAFTDIR + config.SERVERLOG
    activeUsers = open(activeUsersFile, "r").readlines()[-1:]
    activeUsers = [i.rstrip()[27:] for i in activeUsers]