1
0
mirror of https://github.com/gryf/wicd.git synced 2026-02-11 03:05:47 +01:00

Centralise path configuration into a single file.

Path configuration was distributed throughout wicd, making it difficult
to move around project files. Centralise the configuration into
wpath.py.
This commit is contained in:
metrics
2007-08-12 00:30:01 +00:00
parent 4e4e87423d
commit ca8810aa4a
8 changed files with 76 additions and 31 deletions

12
misc.py
View File

@@ -10,9 +10,11 @@
# Copyright (C) 2007 Adam Blackburn
#
import os,sys
import os
import sys
import wpath
if __name__ == '__main__':
os.chdir(os.path.dirname(os.path.normpath(os.path.join(os.getcwd(),sys.argv[0]))))
wpath.chdir(__file__)
import re
def Run(cmd,include_std_error=False):
if not include_std_error:
@@ -91,9 +93,9 @@ def ParseEncryption(network):
y+=1
#write the data to the files
#then chmod them so they can't be read by evil little munchkins
fileness = open("encryption/configurations/" + network["bssid"].replace(":","").lower(),"w")
os.chmod("encryption/configurations/" + network["bssid"].replace(":","").lower(),0600)
os.chown("encryption/configurations/" + network["bssid"].replace(":","").lower(), 0, 0)
fileness = open(wpath.networks + network["bssid"].replace(":","").lower(),"w")
os.chmod(wpath.networks + network["bssid"].replace(":","").lower(),0600)
os.chown(wpath.networks + network["bssid"].replace(":","").lower(), 0, 0)
#we could do this above, but we'd like to permod (permission mod) them before we write, so that it can't be read
fileness.write(z)
fileness.close()