Deal with the consequences of an entry-point deprecation in Python.
This commit is contained in:
parent
039c06882e
commit
d9e33a8478
3 changed files with 11 additions and 33 deletions
37
INSTALL.adoc
37
INSTALL.adoc
|
@ -1,45 +1,20 @@
|
||||||
= Installing Open Adventure =
|
= Installing Open Adventure =
|
||||||
|
|
||||||
The instructions below assume your system uses Python 3 by default,
|
Installation now requires Python3 due to a security issue
|
||||||
but the actual Python code in Open Adventure is 2/3-agnostic. Adjust
|
with the YAML library.
|
||||||
the example commands below accordingly.
|
|
||||||
|
|
||||||
1. Install PyYAML for Python 3 (which requires Python 3) and libedit
|
1. Install libedit from http://thrysoee.dk/editline/ (aka: editline)
|
||||||
from http://thrysoee.dk/editline/ (aka: editline) on your system.
|
on your system.
|
||||||
+
|
+
|
||||||
On Debian and Ubuntu: `apt-get install python3-yaml libedit-dev`.
|
On Debian and Ubuntu: `apt-get install libedit-dev`.
|
||||||
+
|
+
|
||||||
On Fedora: `dnf install python3-PyYAML libedit-devel`.
|
On Fedora: `dnf install libedit-devel`.
|
||||||
+
|
|
||||||
If you are using MacPorts on OS X: `port install py3{5,6}-yaml`, as
|
|
||||||
appropriate for your Python 3 version.
|
|
||||||
+
|
+
|
||||||
You can also use pip to install PyYAML: `pip3 install PyYAML`.
|
You can also use pip to install PyYAML: `pip3 install PyYAML`.
|
||||||
|
|
||||||
2. Change to the top-level directory of the source code (e.g., `cd open-adventure`).
|
2. Change to the top-level directory of the source code (e.g., `cd open-adventure`).
|
||||||
|
|
||||||
3. Build with `make`.
|
3. Build with `make`.
|
||||||
+
|
|
||||||
If make returns the following message:
|
|
||||||
+
|
|
||||||
------------------------------------------------
|
|
||||||
Traceback (most recent call last):
|
|
||||||
File "./make_dungeon.py", line 13, in <module>
|
|
||||||
import sys, yaml
|
|
||||||
ImportError: No module named yaml
|
|
||||||
------------------------------------------------
|
|
||||||
+
|
|
||||||
try editing make_dungeon.py to change `#!/usr/bin/env python` to
|
|
||||||
read `#!/usr/bin/env python3`
|
|
||||||
+
|
|
||||||
If you still get the error, use the following command to install yaml with pip:
|
|
||||||
+
|
|
||||||
------------------------------------------------
|
|
||||||
pip install pyyaml
|
|
||||||
------------------------------------------------
|
|
||||||
+
|
|
||||||
Make sure you have `pip` installed on your system. If not, you should
|
|
||||||
install it first. See https://pip.pypa.io/en/stable/installing/
|
|
||||||
|
|
||||||
4. Optionally run a regression test on the code with `make check`.
|
4. Optionally run a regression test on the code with `make check`.
|
||||||
|
|
||||||
|
|
3
NEWS
3
NEWS
|
@ -1,5 +1,8 @@
|
||||||
= Open Adventure project news =
|
= Open Adventure project news =
|
||||||
|
|
||||||
|
Repository head::
|
||||||
|
Update the dungeon maker to avoid a deprecation die to security issues
|
||||||
|
|
||||||
1.8: 2019-04-19::
|
1.8: 2019-04-19::
|
||||||
Minor typo and capitalization glitches in user-visible text fixed & documented.
|
Minor typo and capitalization glitches in user-visible text fixed & documented.
|
||||||
Save format has changed.
|
Save format has changed.
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# This is the open-adventure dungeon generator. It consumes a YAML description of
|
# This is the open-adventure dungeon generator. It consumes a YAML description of
|
||||||
# the dungeon and outputs a dungeon.h and dungeon.c pair of C code files.
|
# the dungeon and outputs a dungeon.h and dungeon.c pair of C code files.
|
||||||
|
@ -523,7 +523,7 @@ def get_travel(travel):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
with open(YAML_NAME, "r") as f:
|
with open(YAML_NAME, "r") as f:
|
||||||
db = yaml.load(f)
|
db = yaml.safe_load(f)
|
||||||
|
|
||||||
locnames = [x[0] for x in db["locations"]]
|
locnames = [x[0] for x in db["locations"]]
|
||||||
msgnames = [el[0] for el in db["arbitrary_messages"]]
|
msgnames = [el[0] for el in db["arbitrary_messages"]]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue