Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Shinga13 committed Mar 7, 2024
1 parent bba376b commit e43f8c3
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[flake8]
ignore=E501,
max-line-length = 110
ignore=E501,F401,E126,W503
max-line-length = 100
6 changes: 4 additions & 2 deletions OSCRUI/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
__all__ = ['app']
from .app import OSCRUI

from .app import OSCRUI
__all__ = [
'app', 'datafunctions', 'datamodels', 'displayer', 'iofunctions', 'leagueconnector'
'style', 'textedit', 'widgetbuilder', 'widgets']
2 changes: 1 addition & 1 deletion OSCRUI/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ def setup_settings_frame(self):
lambda state, i=i: self.settings.setValue(f'dmg_columns|{i}', state))
dmg_hider_layout.addWidget(bt, stretch=1)
dmg_seperator = self.create_frame(
dmg_hider_frame, 'hr', style_override={'background-color': '@lbg'},
dmg_hider_frame, 'hr', style_override={'background-color': '@lbg'},
size_policy=SMINMIN)
dmg_seperator.setFixedHeight(self.theme['defaults']['bw'])
dmg_hider_layout.addWidget(dmg_seperator)
Expand Down
14 changes: 7 additions & 7 deletions OSCRUI/displayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ def create_overview(self):

@setup_plot
def create_grouped_bar_plot(
self, data: dict[str, tuple], time_reference: dict[str, tuple], bar_widget: PlotWidget
) -> QVBoxLayout:
self, data: dict[str, tuple], time_reference: dict[str, tuple],
bar_widget: PlotWidget) -> QVBoxLayout:
"""
Creates a bar plot with grouped bars.
Expand All @@ -126,7 +126,7 @@ def create_grouped_bar_plot(
group_width = 0.18
player_num = len(data)
bar_width = group_width / player_num
relative_bar_positions = np.linspace(0+bar_width/2, group_width-bar_width/2, player_num)
relative_bar_positions = np.linspace(0 + bar_width / 2, group_width - bar_width / 2, player_num)
bar_position_offsets = relative_bar_positions - np.median(relative_bar_positions)

zipper = zip(data.items(), self.theme['plot']['color_cycler'], bar_position_offsets)
Expand Down Expand Up @@ -156,7 +156,7 @@ def create_horizontal_bar_graph(self, table: list[list], bar_widget: PlotWidget)
left_axis.setTickFont(theme_font(self, 'app'))
bar_widget.setDefaultPadding(padding=0.01)

y_annotations = (tuple((index+1, line[0]+line[1]) for index, line in enumerate(table)),)
y_annotations = (tuple((index + 1, line[0] + line[1]) for index, line in enumerate(table)),)
bar_widget.getAxis('left').setTicks(y_annotations)
x = tuple(line[3] for line in table)
y = tuple(range(1, len(x) + 1))
Expand All @@ -168,8 +168,8 @@ def create_horizontal_bar_graph(self, table: list[list], bar_widget: PlotWidget)

@setup_plot
def create_line_graph(
self, data: dict[str, tuple], time_reference: dict[str, tuple], graph_widget: PlotWidget
) -> QVBoxLayout:
self, data: dict[str, tuple], time_reference: dict[str, tuple],
graph_widget: PlotWidget) -> QVBoxLayout:
"""
Creates line plot from data and returns layout that countins the plot.
Expand Down Expand Up @@ -249,7 +249,7 @@ def create_legend_item(self, color: str, name: str) -> QFrame:
colored_patch = QLabel()
colored_patch.setStyleSheet(get_style(self, 'plot_legend', {'background-color': color}))
patch_height = self.theme['app']['frame_thickness']
colored_patch.setFixedSize(2*patch_height, patch_height)
colored_patch.setFixedSize(2 * patch_height, patch_height)
layout.addWidget(colored_patch, alignment=AVCENTER)
label = create_label(
self, name, 'label', style_override={'font': self.theme['plot_legend']['font']})
Expand Down
2 changes: 1 addition & 1 deletion OSCRUI/textedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def clean_player_id(id: str) -> str:
"""
cleans player id and returns handle
"""
return id[id.find(' ')+1:-1]
return id[id.find(' ') + 1:-1]


def clean_entity_id(id: str) -> str:
Expand Down
8 changes: 4 additions & 4 deletions OSCRUI/widgetbuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def create_button(self, text, style: str = 'button', parent=None, style_override


def create_icon_button(
self, icon, tooltip: str = '', style: str = 'icon_button', parent=None, style_override={}
) -> QPushButton:
self, icon, tooltip: str = '', style: str = 'icon_button', parent=None,
style_override={}) -> QPushButton:
"""
Creates a button showing an icon according to style with parent.
Expand Down Expand Up @@ -224,8 +224,8 @@ def create_combo_box(self, parent, style: str = 'combobox', style_override: dict


def create_entry(
self, default_value, validator=None, style: str = 'entry', style_override: dict = {}
) -> QLineEdit:
self, default_value, validator=None, style: str = 'entry',
style_override: dict = {}) -> QLineEdit:
"""
Creates an entry widget and styles it.
Expand Down
2 changes: 1 addition & 1 deletion OSCRUI/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def paintEvent(self, event):
painter = QPainter(self)
painter.setRenderHint(QPainter.RenderHint.SmoothPixmapTransform)
w = int(self.rect().width())
h = int(w * 126/2880)
h = int(w * 126 / 2880)
rect = QRect(0, 0, w, h)
painter.drawPixmap(rect, self.p)
self.setMaximumHeight(h)
Expand Down
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class Launcher():

version = '2024.03a042'
version = '2024.03b070'

# holds the style of the app
theme = {
Expand Down Expand Up @@ -516,7 +516,7 @@ class Launcher():
# holds various properties related to graphing
'plot': {
'color_cycler': ('#8f54b4', '#B14D54', '#89B177', '#545DB4', '#C8B74E',
'#B45492', '#A27534', '#54A9B4', '#E47B1C', '#BCBCBC'),
'#B45492', '#A27534', '#54A9B4', '#E47B1C', '#BCBCBC'),
},
'plot_legend': {
'font': ('Overpass', 11, 'Medium'),
Expand Down Expand Up @@ -600,7 +600,8 @@ def app_config() -> dict:
@staticmethod
def launch():
args = {}
exit_code = OSCRUI(version=Launcher.version, theme=Launcher.theme, args=args,
exit_code = OSCRUI(
version=Launcher.version, theme=Launcher.theme, args=args,
path=Launcher.base_path(), config=Launcher.app_config()).run()
sys.exit(exit_code)

Expand Down

0 comments on commit e43f8c3

Please sign in to comment.