mirror of
https://github.com/norohind/EDMC_SpanshRouter.git
synced 2026-10-22 18:02:08 +03:00
Prevent clipboard from not being properly updated on Linux
This commit is contained in:
1 parent
74da851997
commit
85b9c79c7a
1 file changed
+7
@@ -6,6 +6,9 @@ import csv
|
||||
import os
|
||||
from monitor import monitor
|
||||
|
||||
if sys.platform.startswith('linux'):
|
||||
import subprocess
|
||||
|
||||
|
||||
this = sys.modules[__name__]
|
||||
this.next_stop = "No route planned"
|
||||
@@ -44,9 +47,13 @@ def update_gui():
|
||||
this.waypoint_btn["text"] = this.next_wp_label + this.next_stop
|
||||
|
||||
def copy_waypoint(self=None):
|
||||
if sys.platform == "win32":
|
||||
this.parent.clipboard_clear()
|
||||
this.parent.clipboard_append(this.next_stop)
|
||||
this.parent.update()
|
||||
else:
|
||||
command = subprocess.Popen(["echo", "-n", this.next_stop], stdout=subprocess.PIPE)
|
||||
subprocess.Popen(["xclip", "-selection", "c"], stdin=command.stdout)
|
||||
|
||||
def new_route(self=None):
|
||||
filename = filedialog.askopenfilename(filetypes = (("csv files", "*.csv"),)) # show an "Open" dialog box and return the path to the selected file
|
||||
|
||||
Reference in new issue
Block a user