add freq
[dumbwifi.git] / system.py
blob0c2c99c7fd8e316c6800cb7cc8fa94d3e4854171
1 import os
4 # OS
6 def getfile(path):
7 try:
8 f = open(path)
9 lines = f.read()
10 f.close()
11 return lines
12 except IOError: return ""
14 def as_root():
15 if os.getuid() == 0: return True
17 def os_which(binary):
18 for p in os.environ.get("PATH", "").split(":"):
19 path = "%s/%s" % (p, binary)
20 if os.path.isfile(path): return path
21 return binary