Skip to content

Commit

Permalink
[VuBluetoothSetup/GigaBlueBluetoothSetup]
Browse files Browse the repository at this point in the history
* cleanup imports
  • Loading branch information
jbleyel committed Aug 26, 2024
1 parent e312ebd commit 8dbdb12
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 86 deletions.
10 changes: 1 addition & 9 deletions GigaBlueBluetoothSetup/src/OTAUpdate.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
from __future__ import absolute_import
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox

# Generic
from Tools.BoundFunction import boundFunction
from Tools.Directories import *
from Components.config import config
import os

# GUI (Components)
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Button import Button
from Components.ProgressBar import ProgressBar

# Timer
from enigma import eTimer

from . import bt_types
from .bt_types import getEventDesc
from .bt_task import BluetoothTask

OTA_ERROR_SERVICE_DISCOVERY = 0
Expand Down
36 changes: 10 additions & 26 deletions GigaBlueBluetoothSetup/src/bt.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,19 @@
from __future__ import print_function
from __future__ import absolute_import
from Plugins.Plugin import PluginDescriptor

from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.InputBox import InputBox
from Screens.ChoiceBox import ChoiceBox

from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.config import config, ConfigSelection, getConfigListEntry, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber, ConfigNumber
from Components.ConfigList import ConfigListScreen
from Components.Console import Console
from Components.GUIComponent import GUIComponent
from Components.MenuList import MenuList
from Components.Pixmap import Pixmap, MultiPixmap
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.VolumeControl import VolumeControl

from Tools.BoundFunction import boundFunction
from Components.config import config, ConfigSelection, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber, ConfigNumber

from Tools.Notifications import AddNotification, AddNotificationWithCallback, AddPopup
from Tools.Directories import pathExists, fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_PLUGIN, SCOPE_CURRENT_SKIN, SCOPE_METADIR
from skin import loadSkin

from enigma import eTimer, eServiceReference
from enigma import eDVBVolumecontrol

import os
import re
import time
from . import gbbt
from .bt_types import getEventDesc, isAudioProfile, getIcon
from .bt_types import isAudioProfile
from . import bt_types
from .bt_task import BluetoothTask

Expand Down Expand Up @@ -221,11 +201,15 @@ def __init__(self):
self.initVolumeTimer.start(500, True)

def InitVolume(self):
try:
vol = config.audio.volume.value
if hasattr(config, "volumeControl"):
vol = config.volumeControl.volume.value
self.setVolume(vol)
except:
self.initVolumeTimer.start(100, True)
else:
try:
vol = config.audio.volume.value
self.setVolume(vol)
except:
self.initVolumeTimer.start(100, True)

def setVolume(self, vol):
self.gbbt.setVolume(int(vol))
Expand Down
2 changes: 1 addition & 1 deletion GigaBlueBluetoothSetup/src/bt_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config, ConfigSelection, getConfigListEntry, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber
from Components.config import config, getConfigListEntry, ConfigYesNo
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText

Expand Down
2 changes: 1 addition & 1 deletion GigaBlueBluetoothSetup/src/bt_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from enigma import eTimer
from .bt_types import getEventDesc, isAudioProfile, getIcon
from .bt_types import isAudioProfile, getIcon
from .bt import pybluetooth_instance
from .bt_config import BluetoothSetupConfig
from . import bt_types
Expand Down
5 changes: 1 addition & 4 deletions GigaBlueBluetoothSetup/src/bt_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,18 @@
from __future__ import absolute_import
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Tools.Notifications import AddNotification
from Components.Label import Label
from Components.ActionMap import HelpableActionMap
from Components.config import config
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from enigma import eTimer
from .bt_types import getEventDesc, isAudioProfile, getIcon
from .bt_types import isAudioProfile, getIcon
from .bt import pybluetooth_instance
from .bt_config import BluetoothSetupConfig
from .bt_scan import BluetoothDiscoveryScreen, BluetoothRCUSetup
from .bt_task import BluetoothTask
from . import bt_types
from .OTAUpdate import GbRcuOtaUpdate


class BluetoothSetup(BluetoothTask):
Expand Down
3 changes: 0 additions & 3 deletions GigaBlueBluetoothSetup/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
from Plugins.Plugin import PluginDescriptor
from .bt_setup import BluetoothSetupScreen
from .bt import pybluetooth_instance
from Components.config import config, ConfigBoolean
from enigma import eActionMap, eDVBVolumecontrol
from Tools.HardwareInfo import HardwareInfo
import os

g_BTVolumeControlHandle = None

Expand Down
9 changes: 1 addition & 8 deletions VuBluetoothSetup/src/OTAUpdate.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# GUI (Screens)
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Screens.InputBox import InputBox
from Screens.HelpMenu import HelpableScreen
from Screens.ChoiceBox import ChoiceBox

# Generic
from Tools.BoundFunction import boundFunction
from Tools.Directories import *
from Components.config import config
import os

# GUI (Components)
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import ActionMap
from Components.Label import Label
from Components.Button import Button
from Components.ProgressBar import ProgressBar

# Timer
Expand Down
37 changes: 10 additions & 27 deletions VuBluetoothSetup/src/bt.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@
from Plugins.Plugin import PluginDescriptor

from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Screens.InputBox import InputBox
from Screens.ChoiceBox import ChoiceBox

from Components.Label import Label
from Components.ActionMap import ActionMap
from Components.config import config, ConfigSelection, getConfigListEntry, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber, ConfigNumber
from Components.ConfigList import ConfigListScreen
from Components.Console import Console
from Components.GUIComponent import GUIComponent
from Components.MenuList import MenuList
from Components.Pixmap import Pixmap, MultiPixmap
from Components.Sources.List import List
from Components.Sources.StaticText import StaticText
from Components.VolumeControl import VolumeControl

from Tools.BoundFunction import boundFunction
from Components.config import config, ConfigSelection, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber, ConfigNumber

from Tools.Notifications import AddNotification, AddNotificationWithCallback, AddPopup
from Tools.Directories import pathExists, fileExists, resolveFilename, SCOPE_PLUGINS, SCOPE_CURRENT_PLUGIN, SCOPE_CURRENT_SKIN, SCOPE_METADIR
from skin import loadSkin

from enigma import eTimer, eServiceReference
from enigma import eDVBVolumecontrol

import os
import re
import time
from . import vubt
from .bt_types import getEventDesc, isAudioProfile, getIcon
from .bt_types import isAudioProfile
from . import bt_types

from .OTAUpdate import VuRcuOtaUpdate
Expand Down Expand Up @@ -239,11 +218,15 @@ def __init__(self):
self.initVolumeTimer.start(500, True)

def InitVolume(self):
try:
vol = config.audio.volume.value
if hasattr(config, "volumeControl"):
vol = config.volumeControl.volume.value
self.setVolume(vol)
except:
self.initVolumeTimer.start(100, True)
else:
try:
vol = config.audio.volume.value
self.setVolume(vol)
except:
self.initVolumeTimer.start(100, True)

def setVolume(self, vol):
self.vubt.setVolume(int(vol))
Expand Down
2 changes: 1 addition & 1 deletion VuBluetoothSetup/src/bt_config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from Screens.Screen import Screen
from Components.ActionMap import ActionMap
from Components.config import config, ConfigSelection, getConfigListEntry, ConfigSubsection, ConfigYesNo, ConfigText, ConfigSelectionNumber
from Components.config import config, getConfigListEntry, ConfigYesNo
from Components.ConfigList import ConfigListScreen
from Components.Sources.StaticText import StaticText

Expand Down
3 changes: 0 additions & 3 deletions VuBluetoothSetup/src/bt_setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from Screens.Screen import Screen
from Screens.HelpMenu import HelpableScreen
from Screens.MessageBox import MessageBox
from Tools.Notifications import AddNotification
from Components.Label import Label
from Components.ActionMap import HelpableActionMap
from Components.config import config
Expand All @@ -14,7 +12,6 @@
from .bt_scan import BluetoothDiscoveryScreen, BluetoothRCUSetup
from .bt_task import BluetoothTask
from . import bt_types
from .OTAUpdate import VuRcuOtaUpdate


class BluetoothSetup(BluetoothTask):
Expand Down
3 changes: 0 additions & 3 deletions VuBluetoothSetup/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
from Plugins.Plugin import PluginDescriptor
from .bt_setup import BluetoothSetupScreen
from .bt import pybluetooth_instance
from Components.config import config, ConfigBoolean
from enigma import eActionMap, eDVBVolumecontrol
from Tools.HardwareInfo import HardwareInfo
import os

g_BTVolumeControlHandle = None

Expand Down

0 comments on commit 8dbdb12

Please sign in to comment.