<s> from copy import copy <EOL> from os . path import join as os_path_join <EOL> from PyQt5 . QtGui import ( QPixmap , QPalette , QColor , QFont , QRegion , <EOL> QTransform , QFontDatabase ) <EOL> SMALL_PADDING = <NUM_LIT:5> <EOL> LARGE_PADDING = <NUM_LIT:2> * SMALL_PADDING <EOL> ICON_SIZE = <NUM_LIT> <EOL> USER_SIZE = <NUM_LIT> <EOL> POST_SHADOW_BLUR = <NUM_LIT:15> <EOL> POST_SHADOW_OFFSET = <NUM_LIT:3> <EOL> POST_SPACING_HEAD = int ( ( POST_SHADOW_BLUR - POST_SHADOW_OFFSET ) / <NUM_LIT:2> ) <EOL> POST_SPACING_TAIL = int ( ( POST_SHADOW_BLUR + POST_SHADOW_OFFSET ) / <NUM_LIT:2> ) <EOL> POST_ROUNDNESS = SMALL_PADDING <EOL> POST_SPACING_FULL = POST_SPACING_HEAD + POST_SPACING_TAIL <EOL> FOREGROUND = <NUM_LIT:0> <EOL> BACKGROUND = <NUM_LIT:1> <EOL> VISIBLE_SCROLLBAR = <NUM_LIT:15> <EOL> MEDIA_WIDTH = <NUM_LIT> <EOL> DEFAULT_WINDOW_POS_DIM = ( NotImplemented , <NUM_LIT:0> , <EOL> MEDIA_WIDTH + <NUM_LIT:2> * POST_SPACING_FULL + VISIBLE_SCROLLBAR , <NUM_LIT> ) <EOL> _SANS = '<STR_LIT>' <EOL> _FONT_PATH = os_path_join ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> _BASE_PATH = os_path_join ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONSTANTS = { } <EOL> _rgb = lambda s , a : QColor ( * ( int ( _1 + _2 , <NUM_LIT:16> ) for _1 , _2 in zip ( * ( iter ( s + a ) , ) * <NUM_LIT:2> ) ) ) <EOL> def _image ( file , sub_folder , rotate = None ) : <EOL> pixmap = QPixmap ( os_path_join ( _BASE_PATH , sub_folder , file ) ) <EOL> if rotate is None : <EOL> return pixmap <EOL> transform = QTransform ( ) <EOL> transform . rotate ( rotate ) <EOL> return pixmap . transformed ( transform ) <EOL> def _icon ( file , rotate = None ) : <EOL> return _image ( file , '<STR_LIT>' , rotate ) <EOL> def _static ( file , rotate = None ) : <EOL> return _image ( file , '<STR_LIT>' , rotate ) <EOL> def _palette ( parent , place , string , alpha = <NUM_LIT:100> ) : <EOL> palette = QPalette ( ) <EOL> palette . setColor ( QPalette . Background if place else QPalette . Foreground , <EOL> _rgb ( string , '<STR_LIT>' . format ( round ( <NUM_LIT> * alpha ) ) ) ) <EOL> return palette <EOL> def _color ( string , alpha = <NUM_LIT:100> ) : <EOL> return _rgb ( string , '<STR_LIT>' . format ( round ( <NUM_LIT> * alpha ) ) ) <EOL> def set_gui_constants ( parent ) : <EOL> weights = { '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' } <EOL> weights ^= set ( s + '<STR_LIT>' for s in copy ( weights ) ) <EOL> weights ^= { '<STR_LIT>' , '<STR_LIT>' } <EOL> fonts = QFontDatabase ( ) <EOL> for weight in weights : <EOL> fonts . addApplicationFont ( os_path_join ( _FONT_PATH , <EOL> '<STR_LIT>' . format ( weight ) ) ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , FOREGROUND , '<STR_LIT>' , <NUM_LIT> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , FOREGROUND , '<STR_LIT>' , <NUM_LIT:30> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , FOREGROUND , '<STR_LIT>' , <NUM_LIT> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , BACKGROUND , '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , BACKGROUND , '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _palette ( parent , BACKGROUND , '<STR_LIT>' , <NUM_LIT> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , <NUM_LIT> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' ) <EOL> DEBUG_ALPHA = <NUM_LIT> <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _color ( '<STR_LIT>' , DEBUG_ALPHA ) <EOL> CONSTANTS [ '<STR_LIT>' ] = QFont ( _SANS , <NUM_LIT:16> , QFont . Light ) <EOL> CONSTANTS [ '<STR_LIT>' ] = QFont ( _SANS , <NUM_LIT:10> , QFont . Normal , italic = True ) <EOL> CONSTANTS [ '<STR_LIT>' ] = QFont ( _SANS , <NUM_LIT:12> , QFont . Normal ) <EOL> CONSTANTS [ '<STR_LIT>' ] = QFont ( _SANS , <NUM_LIT:10> , QFont . Normal ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' , rotate = <NUM_LIT> ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _icon ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _static ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = _static ( '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = os_path_join ( _BASE_PATH , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CONSTANTS [ '<STR_LIT>' ] = os_path_join ( _BASE_PATH , '<STR_LIT>' , '<STR_LIT>' ) </s>
