make stat dir

This commit is contained in:
Frank DeMarco 2013-05-30 02:09:53 +09:00
parent 7685c5a08b
commit e486f0ea70
1 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import cProfile
from time import strftime
from os.path import join
from os import mkdir
from os.path import join, exists
from GameChild import GameChild
@ -17,6 +18,9 @@ class Profile(cProfile.Profile, GameChild):
def end(self):
if self.requested():
root = "stat/"
if not exists(root):
mkdir(root)
self.disable()
self.create_stats()
self.dump_stats(join("stat/", strftime("%Y%m%d-%H%M_%S.stat")))
self.dump_stats(join(root, strftime("%Y%m%d-%H%M_%S.stat")))