-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee59b60
commit ba4fe93
Showing
8 changed files
with
100 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import os | ||
|
||
# Info | ||
VERSION = "1.5" | ||
VERSION = "1.6" | ||
NAME = "DRC SIM Server" | ||
|
||
# Port | ||
PORT_WII_MSG = 50010 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from tkinter import Label | ||
|
||
from src.server.data import constants | ||
from src.server.ui.gui.frame.frame_tab import FrameTab | ||
|
||
|
||
class FrameAbout(FrameTab): | ||
def __init__(self, master=None, **kw): | ||
super().__init__(master, **kw) | ||
self.text_name = Label(self, text=constants.NAME) | ||
self.text_version = Label(self, text="v" + constants.VERSION) | ||
|
||
self.text_name.grid(row=0, column=0) | ||
self.text_version.grid(row=1, column=0) | ||
self.grid_columnconfigure(0, weight=1) | ||
|
||
def activate(self): | ||
pass | ||
|
||
def deactivate(self): | ||
pass | ||
|
||
def kill_other_tabs(self): | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import os | ||
import subprocess | ||
from tkinter import Button, CENTER, messagebox | ||
|
||
from src.server.data import constants | ||
from src.server.ui.gui.frame.frame_tab import FrameTab | ||
|
||
|
||
class FrameLog(FrameTab): | ||
def __init__(self, master=None, **kw): | ||
super().__init__(master, **kw) | ||
self.button_log = Button(self, text="Open Log in Console") | ||
self.button_log.bind("<Button-1>", self.button_clicked) | ||
self.button_log.place(relx=0.5, rely=0.5, anchor=CENTER) | ||
self.log = None | ||
|
||
# noinspection PyUnusedLocal | ||
def button_clicked(self, event): | ||
tail = ["x-terminal-emulator", "-e", "tail", "-f"] | ||
for file in ("drcsim", "cli", "gui", "wpa", "backend"): | ||
tail.append(os.path.join(constants.PATH_LOG_DIR, file + ".log")) | ||
self.deactivate() | ||
try: | ||
self.log = subprocess.Popen(tail, stdout=open(os.devnull, "w"), stderr=subprocess.PIPE) | ||
except FileNotFoundError: | ||
messagebox.showerror("Log Error", "Could not open log window.") | ||
|
||
def activate(self): | ||
pass | ||
|
||
def deactivate(self): | ||
if self.log and self.log.poll() is None: | ||
self.log.kill() | ||
|
||
def kill_other_tabs(self): | ||
return False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters