Skip to content

Commit

Permalink
Merge pull request #509 from Ninohana/main
Browse files Browse the repository at this point in the history
移动代码到更合理的位置
  • Loading branch information
Zzaphkiel authored Nov 1, 2024
2 parents 77ee73f + 29b5883 commit c9fed2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 5 additions & 1 deletion app/lol/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
import os
import re
import subprocess
import threading
import time
from asyncio import CancelledError
Expand Down Expand Up @@ -988,7 +989,10 @@ async def spectateDirectly(self, summonerName):
f" {credentials['gameId']}"
f" {self.server}")

return params
pwd = os.getcwd()
os.chdir(f"{cfg.get(cfg.lolFolder)[0]}/../Game")
subprocess.Popen(['League of Legends.exe', f'{params}'])
os.chdir(pwd)

async def dodge(self):
data = {
Expand Down
7 changes: 1 addition & 6 deletions app/view/auxiliary_interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import stat
import subprocess
import threading

from PyQt5.QtCore import Qt, pyqtSignal, QEvent, QSize
Expand Down Expand Up @@ -898,11 +897,7 @@ def info(type, title, content):
if self.spectateTypeComboBox.currentData() == 'LCU':
await connector.spectate(text)
else:
res = await connector.spectateDirectly(text)
pwd = os.getcwd()
os.chdir(f"{cfg.get(cfg.lolFolder)[0]}/../Game")
subprocess.Popen(['League of Legends.exe', f'{res}'])
os.chdir(pwd)
await connector.spectateDirectly(text)

except SummonerNotFound:
info('error', self.tr("Summoner not found"),
Expand Down

0 comments on commit c9fed2a

Please sign in to comment.