@mirakels
You are trying to troll me right? I said this code is existent so please trust me. Also littlesat already proofed it.
And as you don't even understand what these config options do and how it is done, then please don't tell me how we have to handle them, because I know how it works.
No, I'm not the one to troll. even if I disagree with someone. trolling woult be a waste of my time. I have better things to do than that...
If mediaplayer is installed the config.mediaplayer will be instantiated during engima2 startup. So it should just always exist then. But I guess one can even check if the config.mediaplayer is defined and only create a new one if it really does not exist. No you assume it does not exist because on of the subconfig items does not exist.
So the pseudcode should be something like
try access config.mediaplayer
except config.mediaplayer = configsubsection()
try config.mediaplayer.alternateuseragent = 'bla'
except config.mediaplayer.alternatuseragen = configText('bla')
But see for yourself and maybe we can decide if at least we talek about the same thing. Looking for mediaplayer configs and alternateuseragent in the enigma code for openpli and openvix (openatv gives the same results,. Have no code for vti and dream):
openpli/git/enigma2 % grep --exclude po -ri config.mediaplayer .
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: defaultDir = config.MediaPlayer.defaultDir.getValue()
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.MediaPlayer.alwaysHideInfoBar.value or self.ext not in AUDIO_EXTENSIONS and not self.isAudioCD:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.MediaPlayer.saveDirOnExit.getValue():
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: config.MediaPlayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: config.MediaPlayer.defaultDir.save()
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: self.savePlaylistOnExit = config.MediaPlayer.savePlaylistOnExit.getValue()
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.MediaPlayer.repeat.getValue() == True:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.MediaPlayer.sortPlaylists.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.MediaPlayer.sortPlaylists.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: elif ( len(self.playlist) > 0 ) and ( config.MediaPlayer.repeat.getValue() == True ):
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if menuid == "mainmenu" and config.MediaPlayer.onMainMenu.getValue():
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer = ConfigSubsection()
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.repeat = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.savePlaylistOnExit = ConfigYesNo(default=True)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.saveDirOnExit = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.defaultDir = ConfigDirectory()
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.sortPlaylists = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.alwaysHideInfoBar = ConfigYesNo(default=True)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.MediaPlayer.onMainMenu = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: config.MediaPlayer.saveDirOnExit.addNotifier(self.initConfigList)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("repeat playlist"), config.MediaPlayer.repeat))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("save playlist on exit"), config.MediaPlayer.savePlaylistOnExit))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("save last directory on exit"), config.MediaPlayer.saveDirOnExit))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: if not config.MediaPlayer.saveDirOnExit.getValue():
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("start directory"), config.MediaPlayer.defaultDir))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("sorting of playlists"), config.MediaPlayer.sortPlaylists))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("Always hide infobar"), config.MediaPlayer.alwaysHideInfoBar))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("show mediaplayer on mainmenu"), config.MediaPlayer.onMainMenu))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: if self["config"].getCurrent()[1] == config.MediaPlayer.defaultDir:
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: config.MediaPlayer.defaultDir.setValue(path)
openpli/git/enigma2 % grep --exclude po -ri alternateUserAgent .
openpli/git/enigma2 %
openvix/enigma2 % grep --exclude po -ri config.mediaplayer .
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: defaultDir = config.mediaplayer.defaultDir.value
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.mediaplayer.alwaysHideInfoBar.value or self.ext not in AUDIO_EXTENSIONS and not self.isAudioCD:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.mediaplayer.saveDirOnExit.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: config.mediaplayer.defaultDir.setValue(self.filelist.getCurrentDirectory())
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: config.mediaplayer.defaultDir.save()
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: self.savePlaylistOnExit = config.mediaplayer.savePlaylistOnExit.value
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.mediaplayer.repeat.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.mediaplayer.sortPlaylists.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if config.mediaplayer.sortPlaylists.value:
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: elif ( len(self.playlist) > 0 ) and ( config.mediaplayer.repeat.value == True ):
./lib/python/Plugins/Extensions/MediaPlayer/plugin.py: if menuid == "mainmenu" and config.mediaplayer.onMainMenu.value:
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer = ConfigSubsection()
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.repeat = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.savePlaylistOnExit = ConfigYesNo(default=True)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.saveDirOnExit = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.defaultDir = ConfigDirectory()
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.sortPlaylists = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.alwaysHideInfoBar = ConfigYesNo(default=True)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py:config.mediaplayer.onMainMenu = ConfigYesNo(default=False)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: config.mediaplayer.saveDirOnExit.addNotifier(self.initConfigList)
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("repeat playlist"), config.mediaplayer.repeat))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("save playlist on exit"), config.mediaplayer.savePlaylistOnExit))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("save last directory on exit"), config.mediaplayer.saveDirOnExit))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: if not config.mediaplayer.saveDirOnExit.value:
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("start directory"), config.mediaplayer.defaultDir))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("sorting of playlists"), config.mediaplayer.sortPlaylists))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("Always hide infobar"), config.mediaplayer.alwaysHideInfoBar))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: self.list.append(getConfigListEntry(_("show mediaplayer on mainmenu"), config.mediaplayer.onMainMenu))
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: if self["config"].getCurrent()[1] == config.mediaplayer.defaultDir:
./lib/python/Plugins/Extensions/MediaPlayer/settings.py: config.mediaplayer.defaultDir.setValue(path)
openvix/enigma2 % grep --exclude po -ri alternateUserAgent .
openvix/enigma2 %
So no mediaplayer stuff outside the mediaplaer plugin, and no alternatuseragent anywhere. Now alternateuseragent may be found in vti and dream engima code.
But if it exist in there, your 'try config.mediaplayer.alterateuseragent.' would just work and you do not need the 'except'. But in openpli and openvix the 'try' would fail but that is no issue as the alternateuseragent is not in use (according to the above). So in both cases a 'except pass' would suffice I think.
Agai, I assume we are talking about the same thing. Otherwise ignore all my comments... But if I'm wrong whaile we talk about the same thing I would be very interested in learning to know where my reasoning is flawed...
Geen wonder... Had slechts een dm7000, maar wel ook een rotor. eigenlijk al een tijdje ook een dm600 en dm7025. Maar nu kijkend met een et9000 en vuduo