diff options
author | Florian Zeitz <florob@babelmonkeys.de> | 2016-09-15 09:08:36 +0200 |
---|---|---|
committer | Florian Zeitz <florob@babelmonkeys.de> | 2016-09-15 22:55:24 +0200 |
commit | 746d75dee7fb6291a900e0162345354e6eb41c13 (patch) | |
tree | 8837a57482ccecebb44a4e9030804654c9526a92 /voctogui/lib/ui.py | |
parent | 27f9bb1c2aeebae5c1482d9b5f33e990f6cfb68b (diff) |
voctogui: pep8ify
* Indent by 4 spaces
* Use spaces around infix operators
* Reformat some argument lists
* One import per line
* Start line comments with '# '
* Two newlines before free functions
* One newline before methods
Diffstat (limited to 'voctogui/lib/ui.py')
-rw-r--r-- | voctogui/lib/ui.py | 136 |
1 files changed, 73 insertions, 63 deletions
diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py index 553682c..92d0692 100644 --- a/voctogui/lib/ui.py +++ b/voctogui/lib/ui.py @@ -1,4 +1,5 @@ -import gi, logging +import gi +import logging from gi.repository import Gtk, Gst, Gdk, GLib from lib.config import Config @@ -15,67 +16,76 @@ from lib.toolbar.composition import CompositionToolbarController from lib.toolbar.streamblank import StreamblankToolbarController from lib.toolbar.misc import MiscToolbarController -class Ui(UiBuilder): - def __init__(self, uifile): - self.log = logging.getLogger('Ui') - super().__init__(uifile) - - def setup(self): - self.log.info('Initializing Ui') - - # Aquire the Main-Window from the UI-File - self.win = self.get_check_widget('window') - - # Connect Close-Handler - self.win.connect('delete-event', Gtk.main_quit) - - - # Create Audio-Level Display - drawing_area = self.find_widget_recursive(self.win, 'audiolevel_main') - self.audio_level_display = AudioLevelDisplay(drawing_area) - - - # Create Main-Video Overlay Controller - drawing_area = self.find_widget_recursive(self.win, 'video_overlay_drawingarea') - self.video_warning_overlay = VideoWarningOverlay(drawing_area) - - - # Create Main-Video Display - drawing_area = self.find_widget_recursive(self.win, 'video_main') - self.main_video_display = VideoDisplay(drawing_area, - port=11000, - play_audio=Config.getboolean('mainvideo', 'playaudio'), - level_callback=self.audio_level_display.level_callback) - - - # Setup Preview Controller - drawing_area = self.find_widget_recursive(self.win, 'box_left') - self.video_previews_controller = VideoPreviewsController(drawing_area, - win=self.win, - uibuilder=self) - - drawing_area = self.find_widget_recursive(self.win, 'combo_audio') - self.audio_selector_controller = AudioSelectorController(drawing_area, - win=self.win, - uibuilder=self) - - - # Setup Toolbar Controllers - toolbar = self.find_widget_recursive(self.win, 'toolbar') - self.composition_toolbar_controller = CompositionToolbarController(toolbar, - win=self.win, - uibuilder=self) - - self.streamblank_toolbar_controller = StreamblankToolbarController(toolbar, - win=self.win, - uibuilder=self, - warning_overlay=self.video_warning_overlay) - - self.misc_controller = MiscToolbarController(toolbar, - win=self.win, - uibuilder=self) +class Ui(UiBuilder): - def show(self): - self.log.info('Showing Main-Window') - self.win.show_all() + def __init__(self, uifile): + self.log = logging.getLogger('Ui') + super().__init__(uifile) + + def setup(self): + self.log.info('Initializing Ui') + + # Aquire the Main-Window from the UI-File + self.win = self.get_check_widget('window') + + # Connect Close-Handler + self.win.connect('delete-event', Gtk.main_quit) + + # Create Audio-Level Display + drawing_area = self.find_widget_recursive(self.win, 'audiolevel_main') + self.audio_level_display = AudioLevelDisplay(drawing_area) + + # Create Main-Video Overlay Controller + drawing_area = self.find_widget_recursive(self.win, + 'video_overlay_drawingarea') + self.video_warning_overlay = VideoWarningOverlay(drawing_area) + + # Create Main-Video Display + drawing_area = self.find_widget_recursive(self.win, 'video_main') + self.main_video_display = VideoDisplay( + drawing_area, + port=11000, + play_audio=Config.getboolean('mainvideo', 'playaudio'), + level_callback=self.audio_level_display.level_callback + ) + + # Setup Preview Controller + drawing_area = self.find_widget_recursive(self.win, 'box_left') + self.video_previews_controller = VideoPreviewsController( + drawing_area, + win=self.win, + uibuilder=self + ) + + drawing_area = self.find_widget_recursive(self.win, 'combo_audio') + self.audio_selector_controller = AudioSelectorController( + drawing_area, + win=self.win, + uibuilder=self + ) + + # Setup Toolbar Controllers + toolbar = self.find_widget_recursive(self.win, 'toolbar') + self.composition_toolbar_controller = CompositionToolbarController( + toolbar, + win=self.win, + uibuilder=self + ) + + self.streamblank_toolbar_controller = StreamblankToolbarController( + toolbar, + win=self.win, + uibuilder=self, + warning_overlay=self.video_warning_overlay + ) + + self.misc_controller = MiscToolbarController( + toolbar, + win=self.win, + uibuilder=self + ) + + def show(self): + self.log.info('Showing Main-Window') + self.win.show_all() |