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:
5fba7c5
)
Server/py: Add line number handling.
author
Christian Heller
<c.heller@plomlompom.de>
Sun, 22 Feb 2015 04:56:49 +0000
(
05:56
+0100)
committer
Christian Heller
<c.heller@plomlompom.de>
Sun, 22 Feb 2015 04:56:49 +0000
(
05:56
+0100)
plomrogue-server.py
patch
|
blob
|
history
diff --git
a/plomrogue-server.py
b/plomrogue-server.py
index 44c86a949f85a7e1ca614dd26d7dee1f4c0fe8e4..3bcb166ebe3c98bac6900707aee3e47832042d87 100755
(executable)
--- a/
plomrogue-server.py
+++ b/
plomrogue-server.py
@@
-53,9
+53,9
@@
def detect_atomic_leftover(path):
raise SystemExit(msg)
raise SystemExit(msg)
-def obey(cmd, io_db
): #, path_recordfile
):
+def obey(cmd, io_db
, prefix
):
""""""
""""""
- print("
Input
: " + cmd)
+ print("
input " + prefix + "
: " + cmd)
try:
tokens = shlex.split(cmd, comments=True)
except ValueError as err:
try:
tokens = shlex.split(cmd, comments=True)
except ValueError as err:
@@
-82,7
+82,6
@@
def record(cmd, path_recordfile):
file.close()
file.close()
-
io_db = {}
try:
parser = argparse.ArgumentParser()
io_db = {}
try:
parser = argparse.ArgumentParser()
@@
-107,10
+106,12
@@
try:
msg = "No world config file from which to start a new world."
raise SystemExit(msg)
file = open(io_db["path_worldconf"])
msg = "No world config file from which to start a new world."
raise SystemExit(msg)
file = open(io_db["path_worldconf"])
+ line_n = 1
for line in file.readlines():
for line in file.readlines():
- obey(line.rstrip(), io_db)
+ obey(line.rstrip(), io_db, "worldconfig file line " + str(line_n))
+ line_n = line_n + 1
file.close()
file.close()
- obey("MAKE_WORLD " + str(int(time.time())), io_db)
+ obey("MAKE_WORLD " + str(int(time.time())), io_db
, "in file"
)
except SystemExit as exit:
print("ABORTING: " + exit.args[0])
except:
except SystemExit as exit:
print("ABORTING: " + exit.args[0])
except: