added actionlist_template to display action list consistently on different pages
[monitor.git] / monitor / util / file.py
1 #!/usr/bin/python
2 import os
3 import sys
4
5 def setFileFromList(file, list):
6         f = open(file, 'w')
7         for line in list:
8                 f.write(line + "\n")
9         f.close()
10         return True
11
12 def getListFromFile(file):
13         f = open(file, 'r')
14         list = []
15         for line in f:
16                 line = line.strip()
17                 list += [line]
18         return list
19
20 def loadFile(file):
21         f = open(file,'r')
22         buf = f.read()
23         f.close()
24         return buf
25
26 def dumpFile(file, buf):
27         f = open(file, 'wb')
28         f.write(buf)
29         f.close()
30         return