1
0
Fork 0
fgmeta/python3-flightgear
Florent Rougon 8028ce2888 Python: move test modules and data to python3-flightgear/flightgear/meta/tests/
- Move test_catalog.py, test_sgprops.py and catalog/testData/ to
  python3-flightgear/flightgear/meta/tests/.
- Copy catalog/fgaddon-catalog/ to the same place (it is needed by
  test_catalog.py).
- Adapt test_catalog.py and test_sgprops.py accordingly.
- Remove the executable bits from test_catalog.py and test_sgprops.py:
  this is because test_catalog.py can't be run directly anymore; well,
  it can but 3 tests would fail in this setup. No time to investigate
  why (sorry), but this commit adds a README.txt in
  python3-flightgear/flightgear/meta/tests/README.txt that explains how
  to run the tests in a way that works (basically, run
  'python3 -m unittest' from the python3-flightgear directory).

For a bit more context, see
<https://sourceforge.net/p/flightgear/mailman/message/37042247/>.
2020-06-22 00:30:51 +02:00
..
flightgear Python: move test modules and data to python3-flightgear/flightgear/meta/tests/ 2020-06-22 00:30:51 +02:00
README.md i18n: move the scripts to the top-level 'i18n' directory 2020-06-19 18:26:43 +02:00
rebuild-fgdata-embedded-resources Initial version of rebuild-fgdata-embedded-resources 2017-08-18 13:41:21 +02:00

Python code for FlightGear “meta” work

The flightgear directory contains FlightGear-specific Python 3 modules. These modules are mostly of interest to FlightGear developers.

Telling your Python interpreter how to access the modules

In order to run most of the Python scripts in FGMeta, your Python 3 installation must have the /path/to/fgmeta/python3-flightgear directory in its sys.path. One way to do this is to use something like the following in your shell setup:

export PYTHONPATH="/path/to/fgmeta/python3-flightgear"

This example uses Bourne-style syntax; adjust for your particular shell. Several directories may be added this way using a colon separator on Unix, and presumably a semicolon on Windows.

An alternative to setting PYTHONPATH is to add .pth files in special directories of your Python installation(s). For instance, you can create a file, say, FlightGear-FGMeta.pth, containing a single line (with no space at the beginning):

/path/to/fgmeta/python3-flightgear

If you want the modules present in /path/to/fgmeta/python3-flightgear to be accessible to a particular Python interpreter (say, a Python 3.8), simply put the .pth file in /path/to/python-install-dir/lib/python3.8/site-packages/. This can even be a virtual environment if you want. For the system Python interpreters on Debian, you can put the .pth file in, e.g, /usr/local/lib/python3.8/dist-packages/. Note that you may add more lines to a .pth file in case you want to add other paths to the Python interpreter's sys.path.

The scripts

Once you've done the above setup, the Python 3 scripts in FGMeta should run fine. This concerns in particular scripts located in the following top-level directories of FGMeta:

catalog   Generation of aircraft catalogs
i18n      Management of translations in FlightGear (i18n stands for
          “internationalization”)