From fcb4ba606c949b799eb295f43a38fce82db694e5 Mon Sep 17 00:00:00 2001 From: Adriana Draghici Date: Sat, 17 Apr 2010 11:30:25 +0000 Subject: [PATCH] autorun: changed path for sessions info file. --- autorun/Util.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/autorun/Util.py b/autorun/Util.py index bc00d66..0cbb4ed 100644 --- a/autorun/Util.py +++ b/autorun/Util.py @@ -6,7 +6,15 @@ SERVER_TYPE = "python" SERVER_PORT = 10004 SERVER_HOST = "172.16.20.3" -SESSIONS_FILE = "/home/p2p/sessions.txt" # TO CHANGE +import os +def get_sessions_file_path(): + dirpath = os.environ['HOME']+"/"+".autorun/" + if not os.path.exists(dirpath): + os.mkdir(dirpath) + path = dirpath +"sessions.txt" # FIND A BETTER NAME!!! + return path + +SESSIONS_FILE = get_sessions_file_path() BUFFER_SIZE = 4096 """ Message types: client -> server """ -- 2.20.1