home
·
contact
·
privacy
projects
/
plomrogue
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6ddf68a
)
Server/py: Apply pep8 style.
author
Christian Heller
<c.heller@plomlompom.de>
Tue, 17 Feb 2015 00:12:15 +0000
(
01:12
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Tue, 17 Feb 2015 00:12:15 +0000
(
01:12
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index 04bc1d699148d960b4d9cf1518cf80e7e6e04505..f78d12b71a932c4f8b7616ed8e967b41d4971ed9 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-1,4
+1,7
@@
-import errno, os, time
+import errno
+import os
+import time
+
def setup_server_io(io_db):
"""Fill IO files DB with proper file( path)s. Write process IO test string.
def setup_server_io(io_db):
"""Fill IO files DB with proper file( path)s. Write process IO test string.
@@
-23,16
+26,17
@@
def setup_server_io(io_db):
io_db["file_in"].close()
io_db["file_in"] = open(io_db["path_in"], "r")
io_db["file_in"].close()
io_db["file_in"] = open(io_db["path_in"], "r")
+
def cleanup_server_io(io_db):
"""Close and remove all files in IO files DB."""
io_db["file_out"].close()
os.remove(io_db["path_out"])
io_db["file_in"].close()
os.remove(io_db["path_in"])
def cleanup_server_io(io_db):
"""Close and remove all files in IO files DB."""
io_db["file_out"].close()
os.remove(io_db["path_out"])
io_db["file_in"].close()
os.remove(io_db["path_in"])
- if "file_worldstate" in io_db:
# This file is only set up
- io_db["file_worldstate"].close()
# properly when the game
- if os.access(io_db["path_worldstate"], os.F_OK):
# world is active, which is
- os.remove(io_db["path_worldstate"])
#
not guaranteed.
+ if "file_worldstate" in io_db:
# This file's only set up
+ io_db["file_worldstate"].close()
# properly when the game
+ if os.access(io_db["path_worldstate"], os.F_OK):
# world is active, which
+ os.remove(io_db["path_worldstate"])
# is
not guaranteed.
io_db = {}
try:
io_db = {}
try: