Reformat with black

This commit is contained in:
leha-code 2022-03-11 21:14:27 -04:00
parent ac24026242
commit a92c443826
No known key found for this signature in database
GPG Key ID: 15227A6455DDF7EE
3 changed files with 56 additions and 42 deletions

View File

@ -3,7 +3,10 @@ import os
def get_features_list() -> list:
features = subprocess.run(["minecraft-pi-reborn-client", '--print-available-feature-flags'], stdout=subprocess.PIPE).stdout.decode('utf-8')
features = subprocess.run(
["minecraft-pi-reborn-client", "--print-available-feature-flags"],
stdout=subprocess.PIPE,
).stdout.decode("utf-8")
features = features.split("\n")
returnlist = list()
for feature in features:
@ -17,7 +20,10 @@ def get_features_list() -> list:
def get_features_dict() -> dict:
features = subprocess.run(["minecraft-pi-reborn-client", '--print-available-feature-flags'], stdout=subprocess.PIPE).stdout.decode('utf-8')
features = subprocess.run(
["minecraft-pi-reborn-client", "--print-available-feature-flags"],
stdout=subprocess.PIPE,
).stdout.decode("utf-8")
features = features.split("\n")
returndict = dict()
for feature in features:
@ -57,5 +63,8 @@ def set_options(env, options: dict):
env["MCPI_FEATURE_FLAGS"] = output
return env
def run(env):
return subprocess.Popen(['/usr/bin/minecraft-pi-reborn-client'], env=env, preexec_fn=os.setsid)
return subprocess.Popen(
["/usr/bin/minecraft-pi-reborn-client"], env=env, preexec_fn=os.setsid
)

View File

@ -72,13 +72,13 @@ class Planet(QMainWindow):
tabs.setMovable(True)
play_tab = tabs.addTab(self.play_tab(), "Play")
tabs.setTabIcon(play_tab, QIcon('assets/logo512.png'))
tabs.setTabIcon(play_tab, QIcon("assets/logo512.png"))
features_tab = tabs.addTab(self.features_tab(), "Features")
tabs.setTabIcon(features_tab, QIcon('assets/heart512.png'))
tabs.setTabIcon(features_tab, QIcon("assets/heart512.png"))
mods_tab = tabs.addTab(self.custom_mods_tab(), "Mods")
tabs.setTabIcon(mods_tab, QIcon('assets/portal512.png'))
tabs.setTabIcon(mods_tab, QIcon("assets/portal512.png"))
changelog_tab = tabs.addTab(self.changelog_tab(), "Changelog")
tabs.setTabIcon(changelog_tab, QIcon('assets/pi512.png'))
tabs.setTabIcon(changelog_tab, QIcon("assets/pi512.png"))
self.setCentralWidget(tabs)
@ -105,15 +105,14 @@ class Planet(QMainWindow):
if random.randint(1, 100) == 1:
namelabel.setText("Pluto Launcher")
else:
namelabel.setText('Planet Launcher')
namelabel.setText("Planet Launcher")
font = namelabel.font()
font.setPointSize(30)
namelabel.setFont(font)
namelabel.setAlignment(Qt.AlignLeft)
splashlabel = QLabel(f"<font color=\"gold\">{random.choice(SPLASHES)}</font>")
splashlabel = QLabel(f'<font color="gold">{random.choice(SPLASHES)}</font>')
splashlabel.adjustSize()
splashlabel.setAlignment(Qt.AlignHCenter)
@ -240,7 +239,11 @@ class Planet(QMainWindow):
def changelog_tab(self):
web = QWebView()
web.load(QUrl().fromLocalFile(f"{pathlib.Path(__file__).parent.absolute()}/assets/changelog.html"))
web.load(
QUrl().fromLocalFile(
f"{pathlib.Path(__file__).parent.absolute()}/assets/changelog.html"
)
)
print(f"{pathlib.Path(__file__).parent.absolute()}/assets/changelog.html")
return web
@ -254,7 +257,9 @@ class Planet(QMainWindow):
def launch(self):
self.env = launcher.set_username(self.env, self.usernameedit.text())
self.env = launcher.set_options(self.env, self.launchfeatures)
self.env = launcher.set_render_distance(self.env, self.distancebox.currentText())
self.env = launcher.set_render_distance(
self.env, self.distancebox.currentText()
)
print(self.env)