def _helper_installer(action):
if action not in ('install', 'uninstall'):
raise Exception('Wrong action: %s' % action)
if IS_LINUX:
cmd = 'bitmask_helpers ' + action
if STANDALONE:
binary_path = os.path.join(here(), "bitmask")
cmd = "%s %s" % (binary_path, cmd)
if os.getuid() != 0:
cmd = 'pkexec ' + cmd
retcode, output = commands.getstatusoutput(cmd)
if retcode != 0:
log.error('Error installing/uninstalling helpers: %s' % output)
log.error('Command was: %s' % cmd)
raise Exception('Could not install/uninstall helpers')
else:
raise Exception('No install mechanism for this platform')
评论列表
文章目录