aboutsummaryrefslogtreecommitdiff
path: root/mcwrapper/wrapper.py
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2016-10-23 12:53:45 +0200
committerKarel Kočí <cynerd@email.cz>2016-10-23 12:53:45 +0200
commitf556c681a5afae36a7d7c11ade5854a6de4a0896 (patch)
tree90d4442c0b5a20fc589faf9e10866b8eba868e37 /mcwrapper/wrapper.py
parentfcbf1c073d90c09e27b2ba69ca62b89ad6e1b063 (diff)
downloadmcserver-wrapper-f556c681a5afae36a7d7c11ade5854a6de4a0896.tar.gz
mcserver-wrapper-f556c681a5afae36a7d7c11ade5854a6de4a0896.tar.bz2
mcserver-wrapper-f556c681a5afae36a7d7c11ade5854a6de4a0896.zip
Add message of the day feature
Diffstat (limited to 'mcwrapper/wrapper.py')
-rw-r--r--mcwrapper/wrapper.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/mcwrapper/wrapper.py b/mcwrapper/wrapper.py
index 1896266..3e9a0d7 100644
--- a/mcwrapper/wrapper.py
+++ b/mcwrapper/wrapper.py
@@ -36,11 +36,11 @@ class MCWrapper:
try:
os.kill(lpid, 0)
except OSError:
- prints.warning("Detected forced termination of previous server "
- "wrapper instance.")
+ prints.warning("Detected forced termination of previous server"
+ " wrapper instance.")
else:
- prints.error("Another wrapper is running with given identifier.",
- -1, 1)
+ prints.error("Another wrapper is running with given "
+ "identifier.", -1, 1)
try:
os.mkfifo(__INPUTPIPE__, 0o640)
except FileExistsError:
@@ -75,11 +75,6 @@ class MCWrapper:
except FileNotFoundError:
pass
- def execstart(self):
- "Start execution of Minecraft server and hold until its exits"
- self.start()
- self.process.wait()
-
def start(self):
"Start Minecraft server"
self.process = subprocess.Popen(
@@ -111,7 +106,7 @@ class MCWrapper:
def write_to_terminal(self, text):
"Write to server terminal. If server not running it does nothing"
if self.status == 2:
- prints.info("Input: " + text, 1)
+ prints.info("Input: " + text.rstrip(), 1)
self.process.stdin.write(bytes(text, sys.getdefaultencoding()))
self.process.stdin.flush()
return True