remove remote filter lists
This commit is contained in:
parent
45921a4487
commit
a0beb42e89
@ -198,12 +198,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -208,12 +208,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -209,12 +209,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -154,12 +154,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -208,12 +208,8 @@ port=22447
|
|||||||
socketpath=/tmp/
|
socketpath=/tmp/
|
||||||
# allow settings to overwrite
|
# allow settings to overwrite
|
||||||
enableSettingsRemote=True
|
enableSettingsRemote=True
|
||||||
# permitted settings
|
|
||||||
allowSettings=barrier#enabled
|
|
||||||
# allow commands to be executed
|
# allow commands to be executed
|
||||||
enableCommandRemote=True
|
enableCommandRemote=True
|
||||||
# permitted commands
|
|
||||||
allowCommands=say,interrupt,window,resetwindow
|
|
||||||
|
|
||||||
[barrier]
|
[barrier]
|
||||||
enabled=True
|
enabled=True
|
||||||
|
@ -126,7 +126,7 @@ class remoteManager():
|
|||||||
def handleSettingsChange(self, settingsText):
|
def handleSettingsChange(self, settingsText):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableSettingsRemote'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableSettingsRemote'):
|
||||||
return
|
return
|
||||||
|
|
||||||
upperSettingsText = settingsText.upper()
|
upperSettingsText = settingsText.upper()
|
||||||
# set setting
|
# set setting
|
||||||
if upperSettingsText.startswith(self.setSettingConst):
|
if upperSettingsText.startswith(self.setSettingConst):
|
||||||
@ -138,14 +138,9 @@ class remoteManager():
|
|||||||
def handleCommandExecution(self, commandText):
|
def handleCommandExecution(self, commandText):
|
||||||
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableCommandRemote'):
|
if not self.env['runtime']['settingsManager'].getSettingAsBool('remote', 'enableCommandRemote'):
|
||||||
return
|
return
|
||||||
allowCommands = self.env['runtime']['settingsManager'].getSetting('remote', 'allowCommands').upper().split(',')
|
|
||||||
upperCommandText = commandText.upper()
|
upperCommandText = commandText.upper()
|
||||||
allowed = False
|
|
||||||
for a in allowCommands:
|
|
||||||
if upperCommandText.startswith(a):
|
|
||||||
allowed = True
|
|
||||||
if not allowed:
|
|
||||||
return
|
|
||||||
# say
|
# say
|
||||||
if upperCommandText.startswith(self.sayConst):
|
if upperCommandText.startswith(self.sayConst):
|
||||||
parameterText = commandText[len(self.sayConst):]
|
parameterText = commandText[len(self.sayConst):]
|
||||||
@ -184,9 +179,7 @@ class remoteManager():
|
|||||||
def resetSettings(self):
|
def resetSettings(self):
|
||||||
self.env['runtime']['settingsManager'].resetSettingArgDict()
|
self.env['runtime']['settingsManager'].resetSettingArgDict()
|
||||||
def setSettings(self, settingsArgs):
|
def setSettings(self, settingsArgs):
|
||||||
allowSettings = self.env['runtime']['settingsManager'].getSetting('remote', 'allowSettings').upper().split(',')
|
self.env['runtime']['settingsManager'].parseSettingArgs(settingsArgs)
|
||||||
|
|
||||||
self.env['runtime']['settingsManager'].parseSettingArgs(settingsArgs, allowSettings)
|
|
||||||
def handleRemoteIncomming(self, eventData):
|
def handleRemoteIncomming(self, eventData):
|
||||||
if not eventData:
|
if not eventData:
|
||||||
return
|
return
|
||||||
|
@ -86,9 +86,7 @@ settingsData = {
|
|||||||
'port': 22447,
|
'port': 22447,
|
||||||
'socketpath':'/tmp/',
|
'socketpath':'/tmp/',
|
||||||
'enableSettingsRemote': True,
|
'enableSettingsRemote': True,
|
||||||
'allowSettings': 'barrier#enabled',
|
|
||||||
'enableCommandRemote': True,
|
'enableCommandRemote': True,
|
||||||
'allowCommands': 'say,interrupt,window,resetwindow',
|
|
||||||
},
|
},
|
||||||
'barrier':{
|
'barrier':{
|
||||||
'enabled': True,
|
'enabled': True,
|
||||||
|
@ -87,10 +87,10 @@ class settingsManager():
|
|||||||
value = ''
|
value = ''
|
||||||
try:
|
try:
|
||||||
value = self.settingArgDict[section.lower()][setting.lower()]
|
value = self.settingArgDict[section.lower()][setting.lower()]
|
||||||
return value
|
return value
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
value = self.env['settings'].get(section, setting)
|
value = self.env['settings'].get(section, setting)
|
||||||
except:
|
except:
|
||||||
value = str(self.settings[section][setting])
|
value = str(self.settings[section][setting])
|
||||||
@ -100,7 +100,7 @@ class settingsManager():
|
|||||||
value = 0
|
value = 0
|
||||||
try:
|
try:
|
||||||
value = int(self.settingArgDict[section.lower()][setting.lower()])
|
value = int(self.settingArgDict[section.lower()][setting.lower()])
|
||||||
return value
|
return value
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
@ -113,9 +113,9 @@ class settingsManager():
|
|||||||
value = 0.0
|
value = 0.0
|
||||||
try:
|
try:
|
||||||
value = float(self.settingArgDict[section.lower()][setting.lower()])
|
value = float(self.settingArgDict[section.lower()][setting.lower()])
|
||||||
return value
|
return value
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
value = self.env['settings'].getfloat(section, setting)
|
value = self.env['settings'].getfloat(section, setting)
|
||||||
except:
|
except:
|
||||||
@ -160,7 +160,7 @@ class settingsManager():
|
|||||||
try:
|
try:
|
||||||
self.env['runtime'][driverType].shutdown()
|
self.env['runtime'][driverType].shutdown()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
pass
|
||||||
del self.env['runtime'][driverType]
|
del self.env['runtime'][driverType]
|
||||||
|
|
||||||
def setFenrirKeys(self, keys):
|
def setFenrirKeys(self, keys):
|
||||||
@ -185,21 +185,14 @@ class settingsManager():
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
self.settingArgDict[section] = {}
|
self.settingArgDict[section] = {}
|
||||||
self.settingArgDict[section][option] = str(value)
|
self.settingArgDict[section][option] = str(value)
|
||||||
|
|
||||||
def parseSettingArgs(self, settingArgs, allowSettings = None):
|
def parseSettingArgs(self, settingArgs):
|
||||||
for optionElem in settingArgs.split(';'):
|
for optionElem in settingArgs.split(';'):
|
||||||
if len(optionElem.split('#',1)) != 2:
|
if len(optionElem.split('#',1)) != 2:
|
||||||
continue
|
continue
|
||||||
if len(optionElem.split('#',1)[1].split('=',1)) != 2:
|
if len(optionElem.split('#',1)[1].split('=',1)) != 2:
|
||||||
continue
|
continue
|
||||||
allowed = False
|
|
||||||
if allowSettings:
|
|
||||||
for a in allowSettings:
|
|
||||||
if a in optionElem:
|
|
||||||
allowed = True
|
|
||||||
if not allowed:
|
|
||||||
continue
|
|
||||||
|
|
||||||
section = str(optionElem.split('#',1)[0]).lower()
|
section = str(optionElem.split('#',1)[0]).lower()
|
||||||
option = str(optionElem.split('#',1)[1].split('=',1)[0]).lower()
|
option = str(optionElem.split('#',1)[1].split('=',1)[0]).lower()
|
||||||
value = optionElem.split('#',1)[1].split('=',1)[1]
|
value = optionElem.split('#',1)[1].split('=',1)[1]
|
||||||
@ -288,13 +281,13 @@ class settingsManager():
|
|||||||
environment['runtime']['memoryManager'].initialize(environment)
|
environment['runtime']['memoryManager'].initialize(environment)
|
||||||
|
|
||||||
environment['runtime']['attributeManager'] = attributeManager.attributeManager()
|
environment['runtime']['attributeManager'] = attributeManager.attributeManager()
|
||||||
environment['runtime']['attributeManager'].initialize(environment)
|
environment['runtime']['attributeManager'].initialize(environment)
|
||||||
|
|
||||||
environment['runtime']['eventManager'] = eventManager.eventManager()
|
environment['runtime']['eventManager'] = eventManager.eventManager()
|
||||||
environment['runtime']['eventManager'].initialize(environment)
|
environment['runtime']['eventManager'].initialize(environment)
|
||||||
|
|
||||||
environment['runtime']['processManager'] = processManager.processManager()
|
environment['runtime']['processManager'] = processManager.processManager()
|
||||||
environment['runtime']['processManager'].initialize(environment)
|
environment['runtime']['processManager'].initialize(environment)
|
||||||
|
|
||||||
environment['runtime']['outputManager'] = outputManager.outputManager()
|
environment['runtime']['outputManager'] = outputManager.outputManager()
|
||||||
environment['runtime']['outputManager'].initialize(environment)
|
environment['runtime']['outputManager'].initialize(environment)
|
||||||
|
Loading…
Reference in New Issue
Block a user