Enable octal and decimal permission settings

This commit is contained in:
Ruud
2012-03-08 00:51:12 +01:00
parent e2675bd28c
commit 9df218d0a8
2 changed files with 9 additions and 5 deletions
+6 -2
View File
@@ -62,8 +62,12 @@ class Env(object):
return s
@staticmethod
def getPermission(type):
return int(Env.get('settings').get('permission_%s' % type, default = 0777))
def getPermission(setting_type):
perm = Env.get('settings').get('permission_%s' % setting_type, default = '0777')
if perm[0] == '0':
return oct(int(perm, 8))
else:
return oct(int(perm))
@staticmethod
def fireEvent(*args, **kwargs):