mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-21 14:29:55 +00:00
Fix pipe file creation by setting pipe_path file
This commit is contained in:
parent
a59c174849
commit
98527e2cb2
1 changed files with 7 additions and 6 deletions
|
|
@ -202,10 +202,11 @@ class Niko(QWidget):
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
||||||
default_pipe_path = get_pipe_path()
|
pipe_path = get_pipe_path()
|
||||||
if len(sys.argv) == 2 and sys.argv[1] == 'niko':
|
if len(sys.argv) == 2 and sys.argv[1] == 'niko':
|
||||||
# "Niko-leaves-the-screen" mode.
|
# "Niko-leaves-the-screen" mode.
|
||||||
thread = AnimationTimer(pipe = get_pipe_path('niko'))
|
pipe_path = get_pipe_path('niko')
|
||||||
|
thread = AnimationTimer(pipe = pipe_path)
|
||||||
|
|
||||||
niko = Niko(screen_height = app.primaryScreen().size().height(), app = app, thread = thread)
|
niko = Niko(screen_height = app.primaryScreen().size().height(), app = app, thread = thread)
|
||||||
|
|
||||||
|
|
@ -225,18 +226,18 @@ if __name__ == '__main__':
|
||||||
if lang == 'en_US': lang = 'en'
|
if lang == 'en_US': lang = 'en'
|
||||||
journal.change_image('save_' + lang)
|
journal.change_image('save_' + lang)
|
||||||
else:
|
else:
|
||||||
thread = WatchPipe(pipe = default_pipe_path)
|
thread = WatchPipe(pipe = pipe_path)
|
||||||
thread.change_image.connect(journal.change_image)
|
thread.change_image.connect(journal.change_image)
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
if not os.path.exists(default_pipe_path):
|
if not os.path.exists(pipe_path):
|
||||||
pipe_file = open(default_pipe_path, 'w+')
|
pipe_file = open(pipe_path, 'w+')
|
||||||
pipe_file.close()
|
pipe_file.close()
|
||||||
|
|
||||||
app.exec_()
|
app.exec_()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.remove(default_pipe_path)
|
os.remove(pipe_path)
|
||||||
except:
|
except:
|
||||||
# Most likely due to the file being in use, ignore.
|
# Most likely due to the file being in use, ignore.
|
||||||
pass
|
pass
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue