startup.py

./alRom/bin/startup.py · 629 B

From the archive alhaen.tgz

Download the archive   « Back to the archive contents

#!/usr/bin/python

from os import *
from sys import *
from datetime import *
from time import *

inevitableDoom = 1
path = "./alhaen"
port = 5555
while 1:
	try:
		fp = file("core", 'r')
		corename = datetime.now().strftime("core.%b%d-%H:%M:%S%p")
		system("mv core ../core/"+corename)
		if(inevitableDoom == 2):
			exit()
	except(IOError):
		start = datetime.now()
		logname = start.strftime("%b%d-%H:%M:%S%p")
		system(path+" > "+logname)
		end = datetime.now()
		endlog = end.strftime("%b%d-%H:%M:%S%p")
		system("mv "+logname+" ../log/"+logname+"-"+endlog)
		delt = end-start;
		if( delt.seconds < 2 ):
			inevitableDoom = 2;

Site Stats

Snippets: 1791
Codebases: 571