New config (Ignore download times: yes/no)
[enigma2-plugins.git] / rsdownloader / src / RSLog.py
1 ##\r
2 ## RS Downloader\r
3 ## by AliAbdul\r
4 ##\r
5 from RSConfig import config\r
6 from time import strftime, time, localtime\r
7 \r
8 ##############################################################################\r
9 \r
10 def writeLog(message):\r
11         mayWrite = config.plugins.RSDownloader.write_log.value\r
12         \r
13         if mayWrite:\r
14                 log_file = "/tmp/rapidshare.log"\r
15                 \r
16                 try:\r
17                         f = open(log_file, "r")\r
18                         log = f.read()\r
19                         f.close()\r
20                 except:\r
21                         log = ""\r
22                 \r
23                 log = log + strftime("%c", localtime(time())) + " - " + message + "\n"\r
24                 \r
25                 try:\r
26                         f = open(log_file, "w")\r
27                         f.write(log)\r
28                         f.close()\r
29                 except:\r
30                         pass\r