Merge branch 'master' of git.calculate.ru:/calculate-lib

develop
Самоукин Алексей 14 years ago
commit f6ca895df9

Binary file not shown.

@ -278,7 +278,7 @@ class opt(optparse.OptionParser):
[{'longOption':"set",
'optVal':"VAR=VALUE",
'action':'append',
'help':_("set value for variable (comma - delimeter)")
'help':_("set value for variable")
},
{'shortOption':"v",
'longOption':"vars",
@ -371,7 +371,7 @@ is used in conjunction with the option '-v --vars'")
def checkVarSyntax(self,values):
"""Check value of parameter set, was used for change vars"""
reCheckSet = re.compile("^[0-9a-z_]+=[^,]*(,[0-9a-z_]+=[^,]*)*$")
reCheckSet = re.compile("^[0-9a-z_]+=.*$")
if values.set:
for val in values.set:
if not reCheckSet.match(val):

@ -578,12 +578,18 @@ def removeDir(rmDir):
def getRunCommands():
"""List run program"""
def getCmd(procNum):
cmdLineFile = '/proc/%s/cmdline'%procNum
try:
if os.path.exists(cmdLineFile):
return open(cmdLineFile,'r').read().strip()
except:
pass
return ""
if not os.access('/proc',os.R_OK):
return []
return map(lambda x:open('/proc/%s/cmdline'%x).read().strip() \
if os.path.exists('/proc/%s/cmdline') else "",
filter(lambda x:x.isdigit(),
os.listdir('/proc')))
return map(getCmd,filter(lambda x:x.isdigit(),
os.listdir('/proc')))
def isFstabMount(pathname):
"""Get mount point or device from fstab"""

Loading…
Cancel
Save