Compare commits

...

148 Commits
v1.5 ... master

Author SHA1 Message Date
Pacman Ghost 19734ac076 Updated for VASSAL 3.6.7 and VASL 6.6.5. 1 month ago
Pacman Ghost 85b625d54e Updated links to point to pacman-ghost.com. 1 month ago
Pacman Ghost 446a53b32f Fixed a possible timing error during startup. 2 months ago
Pacman Ghost c7a002b1c6 Fixed a test to work inside a Docker container with no internet access. 2 months ago
Pacman Ghost 8172fa7070 Allow the Canadians to generate a PIAT snippet. 2 months ago
Pacman Ghost 330d05e47d Don't show the loading spinner if Javascript is disabled. 2 months ago
Pacman Ghost b285a044ab Updated the documentation. 2 months ago
Pacman Ghost c555614ac6 Updated the examples. 2 months ago
Pacman Ghost 618fe3bd68 Tweaked a log message. 3 months ago
Pacman Ghost 0b720dc8bc Automatically set up basic logging for the desktop app. 3 months ago
Pacman Ghost 499e5645bc When loading a scenario, forget the previous .vsav file used. 3 months ago
Pacman Ghost fc3e1110f8 Worked around a layout problem when the Victory Conditions are long. 3 months ago
Pacman Ghost 8388cec67e Added large flags to the WYSIWYG editor's dropdown. 3 months ago
Pacman Ghost 569edbc48a Added shortcuts for Alt-Shift-< and >. 3 months ago
Pacman Ghost db7fecbc39 Optimized searching for scenarios. 3 months ago
Pacman Ghost 380dae5559 Merged the Extras templates for Kampfgruppe Scherer. 3 months ago
Pacman Ghost e5ad66658a Set focus to the correct default button if there are nested dialogs. 3 months ago
Pacman Ghost c5e1e53df4 Extended the files/directories monitored for Flask hot-reloading. 3 months ago
Pacman Ghost d00d809877 Don't reset the current directory for saving/loading files on "new scenario". 3 months ago
Pacman Ghost c4c2010170 Updated the National Capabilities label for the Free French. 3 months ago
Pacman Ghost c2e0b48343 Added Alt-Click handlers. 3 months ago
Pacman Ghost 0e0df4e3a6 Tightened up some tests. 3 months ago
Pacman Ghost d78ac34c1f Handle missing landing craft Chapter H notes. 3 months ago
Pacman Ghost 05933ad753 Reset the HTML editor controls each time they are used. 3 months ago
Pacman Ghost f6e5081605 Adjusted the layout of the SCENARIO panel. 3 months ago
Pacman Ghost b31f64ed7f Show an indicator when an HTML textbox goes multi-line. 3 months ago
Pacman Ghost 2d317c57bd Moved the "edit template" buttons into a drop-down menu. 3 months ago
Pacman Ghost 941439a2ae Allowed Extras templates to set the width of their dropdown's. 3 months ago
Pacman Ghost 071b6f587d Stopped incorrectly detecting "split MG" v/o comments as having been changed. 3 months ago
Pacman Ghost 437865b47d Improved time-based comments in the Axis Minor nat.caps. snippets. 3 months ago
Pacman Ghost 650a6f86d4 Grouped notes in Nationality Capabilities snippets. 3 months ago
Pacman Ghost 0682dc1dca Added an Extras template for Booby Traps. 3 months ago
Pacman Ghost 4ae19ca212 Tightened up how we detect if HTML content has been changed. 3 months ago
Pacman Ghost e7888e88e0 Cached V/O note images for extensions are now saved in their own sub-directory. 3 months ago
Pacman Ghost 1294d0e3d2 Store config and data files in the standard locations. 3 months ago
Pacman Ghost fbcf4e9184 Confirm closing the EDIT V/O dialog if changes have been made. 3 months ago
Pacman Ghost 6d261032be Improved the keyboard interface in the TURN TRACK dialog. 3 months ago
Pacman Ghost 4629b3421b Only show custom list bullets in the UI if they have been enabled. 3 months ago
Pacman Ghost 53e14f753f Allow single-line textbox's to be edited as HTML. 3 months ago
Pacman Ghost a09286bc50 Include the build git info in the SCENARIO template. 3 months ago
Pacman Ghost 4762a36eb6 Removed code supporting Internet Explorer. 3 months ago
Pacman Ghost 23256bbc63 Tightened up some tests. 3 months ago
Pacman Ghost 2628105ea9 Minor UI tweaks. 3 months ago
Pacman Ghost 77b1bc9548 Allow SSR snippets to be auto-generated. 3 months ago
Pacman Ghost ee4d8fbe02 Fixed a problem when auto-generating a simple note snippet with no content. 3 months ago
Pacman Ghost 2ee42f37b5 Tightened up the presentation of lists in the UI and snippets. 3 months ago
Pacman Ghost 15c632b522 Sanitize HTML content. 3 months ago
Pacman Ghost c420c168d1 Added a WYSIWYG editor for HTML content. 3 months ago
Pacman Ghost d5021f7960 Added the ASA and ROAR ID's to the SCENARIO template. 3 months ago
Pacman Ghost daef7c1c15 Gave VASSAL tests more time to run. 3 months ago
Pacman Ghost b10105f2a7 Improved the positioning and sizing of dialogs. 3 months ago
Pacman Ghost 6b909a37eb Changed how flags are resized. 3 months ago
Pacman Ghost 7e070c3b68 Update the UI after importing an ASA scenario. 4 months ago
Pacman Ghost 0312fa2fc7 Confirm closing the "add/edit simple note" dialog if changes have been made. 4 months ago
Pacman Ghost 95167f4888 Allow snippets to be generated from the "add/edit simple note" dialog. 4 months ago
Pacman Ghost 2a707863d2 Fixed a timing error during startup. 4 months ago
Pacman Ghost 13a1b511e6 Added splitters to make some UI elements resizable. 4 months ago
Pacman Ghost a556d22117 Got 1/2" counters showing at the smaller size again. 4 months ago
Pacman Ghost a52e7f8ba9 Added a splitter to the "edit vehicle/ordnance" dialog. 4 months ago
Pacman Ghost fa5a99e87c Changed how Java is detected (and reported) from the PATH. 4 months ago
Pacman Ghost 7f17a634eb Updated some icons, tightened up the UI. 4 months ago
Pacman Ghost fbc420d4b3 Tightened up the player flags. 4 months ago
Pacman Ghost feebe9f63c Disable snippet-width textbox's when disabling snippet buttons. 5 months ago
Pacman Ghost e479bf2a76 Removed the "Width:" labels from the UI. 5 months ago
Pacman Ghost 520ea43d9d Tidy-up strings coming from ROAR and ASA. 5 months ago
Pacman Ghost ff0f40b22b Tightened up how we map ASA theaters to our own. 5 months ago
Pacman Ghost 55c15e5157 Made the compass label part of the default template pack. 5 months ago
Pacman Ghost 757c78dbd8 Removed the text caption from some snippet buttons. 5 months ago
Pacman Ghost 1079ac7e60 Got the LFA tests going again in Firefox. 5 months ago
Pacman Ghost d165bfdefd Allow multiple levels of shading in the turn track. 5 months ago
Pacman Ghost 729c6e306d Reset the turn track when importing a scenario. 5 months ago
Pacman Ghost cd831446fd Allow turn track squares to be shaded. 5 months ago
Pacman Ghost 40c2b87cbe Added a new extras template for the compass. 5 months ago
Pacman Ghost bc724e426d Removed the option to create National Capabilities labels. 5 months ago
Pacman Ghost c850bbd281 Tweaked the presentation of the "VASSAL shim error" dialog. 5 months ago
Pacman Ghost 42cad6f87c Fixed a resizing problem in the "connect to ROAR" dialog. 5 months ago
Pacman Ghost c363acb73e Added more padding to dialogs. 5 months ago
Pacman Ghost c5cdaf27dd Return a spacer image as a flag for nationalities that don't have one. 5 months ago
Pacman Ghost 0966c08dd4 Added the turn track template. 5 months ago
Pacman Ghost 3a5e472b36 Updated dependencies. 6 months ago
Pacman Ghost f93888c51b Updated the version strings. 6 months ago
Pacman Ghost 786f35be9a Added the Swedish nationality. 8 months ago
Pacman Ghost cde6649918 Added support for VASL 6.6.4 and VASSAL 3.6.6. 8 months ago
Pacman Ghost 0cbce2182c Report the VASSAL and VASL versions when analyzing .vsav files. 9 months ago
Pacman Ghost 0ab71fb70e Added some more logging to the VASSAL shim. 9 months ago
Pacman Ghost 560f2e3e65 Default to showing images in snippets, and using custom list bullets. 9 months ago
Pacman Ghost 7a0c4044e4 Fixed an error caused by the VASL .vmod not loading properly. 9 months ago
Pacman Ghost 5d425f2ded Allow logging to a file during tests. 9 months ago
Pacman Ghost 22274a6183 Improved the help. 9 months ago
Pacman Ghost 0cbe6435cf Completely hide the UI controls if there are no vehicles/ordnance. 9 months ago
Pacman Ghost dad7dab770 Made a new VO_NOTE_IMAGE_URL_PATH parameter available to templates. 9 months ago
Pacman Ghost 114db959bd Minor tweaks to the templates. 9 months ago
Pacman Ghost b497aa6e0f Stop the DOS box from showing when we launch the webdriver. 9 months ago
Pacman Ghost 27bb528312 Updated the flags for the Allied/Axis Minor nationalities. 9 months ago
Pacman Ghost d8c9d20e2c Added some comments. 9 months ago
Pacman Ghost 6f1dbae5c8 Set the location of the geckodriver log file during tests. 9 months ago
Pacman Ghost ba8a2d425b Tightened up how the test suite skips certain versions of VASL. 9 months ago
Pacman Ghost 32efa5b1c7 Updated the Chapter H placeholders ZIP file. 9 months ago
Pacman Ghost 82ab463eab Use different backend webdriver's when running the test suite. 9 months ago
Pacman Ghost fe3d30d2e2 Added the Partisan nationality. 9 months ago
Pacman Ghost 38399c355f Allow VASL versions to be aliased. 9 months ago
Pacman Ghost 5c19af124a Got the embedded browser in the desktop app going again on Fedora 35. 9 months ago
Pacman Ghost 7c4e01eeec Allow URL's for downloaded artifacts for the Docker image to be overridden. 9 months ago
Pacman Ghost aeb3eaf5c8 Updated dependencies. 9 months ago
Pacman Ghost 4288125a7a Added some comments. 12 months ago
Pacman Ghost 44e4ff53dd Got accelerator underlines to show properly on Windows. 12 months ago
Pacman Ghost 1584988476 Show the Java version in the Program Info dialog. 12 months ago
Pacman Ghost dc8a05a78b Show the nationality colors as a palette in the LFA color-picker. 12 months ago
Pacman Ghost cbc86e6fe8 Tightened up the Docker build. 1 year ago
Pacman Ghost 2946b2d10f Use waitress to serve the webapp. 1 year ago
Pacman Ghost 2fc57b88ac Updated the version strings. 1 year ago
Pacman Ghost a1613942d4 Added support for VASSAL 3.5.8 and VASL 6.6.3. 1 year ago
Pacman Ghost 315549cd21 Documented how config files get installed into the Docker container. 1 year ago
Pacman Ghost f4553ca42f Always show the Installation tab in the help. 1 year ago
Pacman Ghost 35c9ee5d53 Documented the Selenium fix. 1 year ago
Pacman Ghost cc09ba179e Show a better error message if we can't get the VASSAL version number. 1 year ago
Pacman Ghost 71d4396678 Fixed some issues in the PF template. 1 year ago
Pacman Ghost 9d7e5d400c Update the UI correctly when reseting a vehicle/ordnance. 1 year ago
Pacman Ghost 8bf314248e Convert file downloads to UTF-8 when running in a browser. 1 year ago
Pacman Ghost 692c7fd33b Changed how the Docker container gets its container ID. 1 year ago
Pacman Ghost 427a3d65c5 Updated all dependencies. 1 year ago
Pacman Ghost 19dc063830 Changed the comment for the Pz VIE SA mines. 1 year ago
Pacman Ghost f23329a3c1 Update SMOKE Depletion Numbers correctly for Elite units. 1 year ago
Pacman Ghost 903f2f29ff Show a splash screen during startup. 1 year ago
Pacman Ghost 4fd57b5e75 Updated the version strings. 1 year ago
Pacman Ghost b5d570ce7b Fixed a test to work with Docker. 1 year ago
Pacman Ghost 84c4757b51 Cache the VASSAL version. 1 year ago
Pacman Ghost 089e43f31e Added a cache for vehicle/ordnance note images. 1 year ago
Pacman Ghost 85a0085a8a Prevented a console warning if asl-rulebook2 has not been configured. 1 year ago
Pacman Ghost 4d15050d72 Added a comment about setting the UID/GID inside the Docker container. 1 year ago
Pacman Ghost b8347f2b68 Changed how logging is configured in a Docker container. 1 year ago
Pacman Ghost 1d17a7ecdf Added some webdriver options. 1 year ago
Pacman Ghost b8c68b916e Added a vehicle entry for the LCV. 1 year ago
Pacman Ghost 94f3a2b8d5 Updated the vehicle/ordnance data with information from the back of counters. 1 year ago
Pacman Ghost 5cdbc3195a Don't change vehicular smoke dispenser depletion #'s for elite status. 1 year ago
Pacman Ghost 8ab4f3c730 Updated the regex for extracting turn track events from a vlog. 2 years ago
Pacman Ghost f3ae34878c Added asl-rulebook2 integration. 2 years ago
Pacman Ghost 1d3af963df Updated the version strings. 2 years ago
Pacman Ghost 687a65e76a Install the correct version of Python into the Docker container. 2 years ago
Pacman Ghost c56438d958 Fixed a possible timing error in the tests. 2 years ago
Pacman Ghost 3a8385023b Fixed Chapter H URL's for derived nationalities. 2 years ago
Pacman Ghost 82f383d6c4 Added some missing entries to the Chapter H placeholder zip. 2 years ago
Pacman Ghost 5936567a98 Added a check for invalid nationalities in a save file. 2 years ago
Pacman Ghost 0bd780e7b5 Added Note D to the British OML 2-in. Mortars. 2 years ago
Pacman Ghost f414a758a0 Added support for VASSAL 3.5.5 and VASL 6.6.2. 2 years ago
Pacman Ghost 4c07d279da Changed the ANZAC nationality to be based on the British. 2 years ago
Pacman Ghost 70edc69cdb Added the Australian nationality. 2 years ago
Pacman Ghost 6dd6ed11ef Updated the version strings. 2 years ago
  1. 90
      .pylintrc
  2. 78
      Dockerfile
  3. 8
      README.md
  4. BIN
      chapter-h/chapter-h-placeholders.zip
  5. 73
      conftest.py
  6. 1
      docker/config/.gitignore
  7. 43
      docker/config/logging.yaml
  8. 2
      docker/config/site.cfg
  9. BIN
      examples/Hill 621 (Scenario E) (online).vsav
  10. 32
      examples/Hill 621 (Scenario E).json
  11. BIN
      examples/Hill 621 (Scenario E).png
  12. BIN
      examples/Hill 621 (Scenario E).small.jpg
  13. BIN
      examples/Hill 621 (Scenario E).vsav
  14. BIN
      examples/Hube's Pocket (Scenario G) (online).vsav
  15. 30
      examples/Hube's Pocket (Scenario G).json
  16. BIN
      examples/Hube's Pocket (Scenario G).png
  17. BIN
      examples/Hube's Pocket (Scenario G).small.jpg
  18. BIN
      examples/Hube's Pocket (Scenario G).vsav
  19. 2
      examples/README.md
  20. BIN
      examples/The Streets Of Stalingrad (Scenario C) (online).vsav
  21. 30
      examples/The Streets Of Stalingrad (Scenario C).json
  22. BIN
      examples/The Streets Of Stalingrad (Scenario C).png
  23. BIN
      examples/The Streets Of Stalingrad (Scenario C).small.jpg
  24. BIN
      examples/The Streets Of Stalingrad (Scenario C).vsav
  25. 302
      freeze.py
  26. BIN
      loader/assets/loading.gif
  27. 107
      loader/freeze.py
  28. 207
      loader/main.py
  29. 12
      requirements-dev.txt
  30. 14
      requirements.txt
  31. 10
      run-container.sh
  32. 19
      setup.py
  33. 4
      tools/build_file.py
  34. 4
      vasl_templates/about.py
  35. 19
      vasl_templates/file_dialog.py
  36. 72
      vasl_templates/main.py
  37. 24
      vasl_templates/main_window.py
  38. 4
      vasl_templates/server_settings.py
  39. 6
      vasl_templates/tools/check_connect_roar.py
  40. 75
      vasl_templates/tools/get_piece_info.py
  41. 23
      vasl_templates/tools/make_chapter_h_placeholders.py
  42. 44
      vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt
  43. 3
      vasl_templates/tools/tests/test_make_chapter_h_placeholders.py
  44. 6
      vasl_templates/tools/webdriver_stress_test.py
  45. 27
      vasl_templates/ui/about.ui
  46. 2
      vasl_templates/ui/server_settings.ui
  47. 29
      vasl_templates/utils.py
  48. 4
      vasl_templates/web_channel.py
  49. 77
      vasl_templates/webapp/__init__.py
  50. 2
      vasl_templates/webapp/config/constants.py
  51. 44
      vasl_templates/webapp/config/logging.yaml.example
  52. 6
      vasl_templates/webapp/config/site.cfg.example
  53. 5
      vasl_templates/webapp/data/asl-scenario-archive.json
  54. 7
      vasl_templates/webapp/data/default-template-pack/atmm-romanian.j2
  55. 2
      vasl_templates/webapp/data/default-template-pack/atmm.j2
  56. 10
      vasl_templates/webapp/data/default-template-pack/baz-cpva16.j2
  57. 10
      vasl_templates/webapp/data/default-template-pack/baz-cpva17.j2
  58. 14
      vasl_templates/webapp/data/default-template-pack/baz.j2
  59. 14
      vasl_templates/webapp/data/default-template-pack/baz45.j2
  60. 14
      vasl_templates/webapp/data/default-template-pack/baz50.j2
  61. 2
      vasl_templates/webapp/data/default-template-pack/common.css
  62. 5
      vasl_templates/webapp/data/default-template-pack/compass.j2
  63. 34
      vasl_templates/webapp/data/default-template-pack/extras/booby-traps.j2
  64. 2
      vasl_templates/webapp/data/default-template-pack/extras/count-remaining.j2
  65. 4
      vasl_templates/webapp/data/default-template-pack/extras/grid.j2
  66. 2
      vasl_templates/webapp/data/default-template-pack/extras/kakazu-ridge-cave-complexes.j2
  67. 87
      vasl_templates/webapp/data/default-template-pack/extras/kgs.j2
  68. 49
      vasl_templates/webapp/data/default-template-pack/extras/kgs/grenade-bundles.j2
  69. 57
      vasl_templates/webapp/data/default-template-pack/extras/kgs/molotov-cocktails.j2
  70. 2
      vasl_templates/webapp/data/default-template-pack/extras/victory-points.j2
  71. 12
      vasl_templates/webapp/data/default-template-pack/mol-p.j2
  72. 6
      vasl_templates/webapp/data/default-template-pack/mol.j2
  73. 15
      vasl_templates/webapp/data/default-template-pack/nat_caps.j2
  74. 235
      vasl_templates/webapp/data/default-template-pack/national-capabilities.json
  75. 23
      vasl_templates/webapp/data/default-template-pack/nationalities.json
  76. 5
      vasl_templates/webapp/data/default-template-pack/ob_vo_note.css
  77. 19
      vasl_templates/webapp/data/default-template-pack/pf-finnish.j2
  78. 18
      vasl_templates/webapp/data/default-template-pack/pf-hungarian.j2
  79. 17
      vasl_templates/webapp/data/default-template-pack/pf-romanian.j2
  80. 28
      vasl_templates/webapp/data/default-template-pack/pf.j2
  81. 10
      vasl_templates/webapp/data/default-template-pack/piat.j2
  82. 2
      vasl_templates/webapp/data/default-template-pack/player_flag.include
  83. 2
      vasl_templates/webapp/data/default-template-pack/player_flag_large.include
  84. 4
      vasl_templates/webapp/data/default-template-pack/players.j2
  85. 10
      vasl_templates/webapp/data/default-template-pack/psk.j2
  86. 4
      vasl_templates/webapp/data/default-template-pack/scenario.j2
  87. 2
      vasl_templates/webapp/data/default-template-pack/ssr.j2
  88. 6
      vasl_templates/webapp/data/default-template-pack/thh.j2
  89. 116
      vasl_templates/webapp/data/default-template-pack/turn_track.j2
  90. 4
      vasl_templates/webapp/data/extensions/bfp-bj-v403.json
  91. 1
      vasl_templates/webapp/data/ordnance/allied-minor/dutch.json
  92. 3
      vasl_templates/webapp/data/ordnance/british.json
  93. 1
      vasl_templates/webapp/data/ordnance/british~anzac.json
  94. 1
      vasl_templates/webapp/data/ordnance/british~australian.json
  95. 2
      vasl_templates/webapp/data/ordnance/finnish.json
  96. 2
      vasl_templates/webapp/data/ordnance/german.json
  97. 26
      vasl_templates/webapp/data/ordnance/swedish.json
  98. 0
      vasl_templates/webapp/data/vasl-6.6.0/expected-multiple-images.json
  99. 0
      vasl_templates/webapp/data/vasl-6.6.0/online-counter-images.json
  100. 65
      vasl_templates/webapp/data/vasl-6.6.0/piece-info.json
  101. Some files were not shown because too many files have changed in this diff Show More

@ -54,88 +54,14 @@ confidence=
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
disable=print-statement,
parameter-unpacking,
unpacking-in-except,
old-raise-syntax,
backtick,
long-suffix,
old-ne-operator,
old-octal-literal,
import-star-module-level,
non-ascii-bytes-literal,
invalid-unicode-literal,
disable=
raw-checker-failed,
bad-inline-option,
locally-disabled,
locally-enabled,
file-ignored,
suppressed-message,
useless-suppression,
deprecated-pragma,
apply-builtin,
basestring-builtin,
buffer-builtin,
cmp-builtin,
coerce-builtin,
execfile-builtin,
file-builtin,
long-builtin,
raw_input-builtin,
reduce-builtin,
standarderror-builtin,
unicode-builtin,
xrange-builtin,
coerce-method,
delslice-method,
getslice-method,
setslice-method,
no-absolute-import,
old-division,
dict-iter-method,
dict-view-method,
next-method-called,
metaclass-assignment,
indexing-exception,
raising-string,
reload-builtin,
oct-method,
hex-method,
nonzero-method,
cmp-method,
input-builtin,
round-builtin,
intern-builtin,
unichr-builtin,
map-builtin-not-iterating,
zip-builtin-not-iterating,
range-builtin-not-iterating,
filter-builtin-not-iterating,
using-cmp-argument,
eq-without-hash,
div-method,
idiv-method,
rdiv-method,
exception-message-attribute,
invalid-str-codec,
sys-max-int,
bad-python3-import,
deprecated-string-function,
deprecated-str-translate-call,
deprecated-itertools-function,
deprecated-types-field,
next-method-defined,
dict-items-not-iterating,
dict-keys-not-iterating,
dict-values-not-iterating,
deprecated-operator-function,
deprecated-urllib-function,
xreadlines-attribute,
deprecated-sys-function,
exception-escape,
comprehension-escape,
bad-whitespace,
bad-continuation,
invalid-name,
wrong-import-position,
global-statement,
@ -146,7 +72,12 @@ disable=print-statement,
len-as-condition,
consider-using-enumerate,
import-outside-toplevel,
isinstance-second-argument-not-valid-type
isinstance-second-argument-not-valid-type,
consider-using-f-string,
consider-using-max-builtin,
use-implicit-booleaness-not-comparison,
unnecessary-lambda-assignment,
duplicate-string-formatting-argument,
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
@ -291,13 +222,6 @@ max-line-length=120
# Maximum number of lines in a module
max-module-lines=1000
# List of optional constructs for which whitespace checking is disabled. `dict-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
# `empty-line` allows space-only lines.
no-space-check=trailing-comma,
dict-separator
# Allow the body of a class to be on the same line as the declaration if body
# contains single statement.
single-line-class-stmt=no

@ -1,61 +1,55 @@
# NOTE: Use the run-container.sh script to build and launch this container.
# We do a multi-stage build (requires Docker >= 17.05) to install everything, then copy it all
# to the final target image.
# NOTE: Multi-stage builds require Docker >= 17.05.
FROM rockylinux:8.5 AS base
FROM centos:8 AS base
# update packages and install requirements
RUN dnf -y upgrade-minimal && \
dnf install -y python39
# update packages
RUN dnf -y upgrade-minimal
# NOTE: We don't need the following stuff for the build step, but it's nice to not have to re-install
# it all every time we change the requirements :-/
# install Python
RUN dnf install -y python38 python3-pip
# install Java
ARG JAVA_URL=https://download.oracle.com/java/17/archive/jdk-17.0.2_linux-x64_bin.tar.gz
RUN curl -s "$JAVA_URL" | tar -xz -C /usr/bin/
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# install Firefox
ARG FIREFOX_URL=https://ftp.mozilla.org/pub/firefox/releases/94.0.2/linux-x86_64/en-US/firefox-94.0.2.tar.bz2
RUN dnf install -y bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \
curl -s "$FIREFOX_URL" | tar -jx -C /usr/local/ && \
ln -s /usr/local/firefox/firefox /usr/bin/firefox && \
echo "exclude=firefox" >>/etc/dnf/dnf.conf
# install geckodriver
ARG GECKODRIVER_URL=https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
RUN curl -sL "$GECKODRIVER_URL" | tar -xz -C /usr/bin/
# clean up
RUN dnf clean all
# NOTE: We install the Python dependencies into a temporary intermediate stage, then copy everything over
# to the final image, because some modules (e.g. grpcio) need pre-requisites to be installed.
# This saves us about 300 MB for the final image and, importantly, adding a requirement doesn't cause us
# to re-install Java and Firefox below, when we start building the final image.
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FROM base AS build
# set up a virtualenv
RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --upgrade pip
# install the application requirements
COPY requirements.txt requirements-dev.txt ./
RUN pip3 install -r requirements.txt
COPY requirements.txt requirements-dev.txt /tmp/
RUN pip3 install -r /tmp/requirements.txt
ARG CONTROL_TESTS_PORT
RUN if [ -n "$CONTROL_TESTS_PORT" ]; then \
dnf install -y gcc-c++ python3-devel && \
pip3 install -r requirements-dev.txt \
pip3 install -r /tmp/requirements-dev.txt \
; fi
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FROM base
# install Java
RUN url="https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz" ; \
curl -s "$url" | tar -C /usr/bin/ -xz
# install Firefox
RUN dnf install -y wget bzip2 xorg-x11-server-Xvfb gtk3 dbus-glib && \
wget -qO- "https://download.mozilla.org/?product=firefox-latest-ssl&os=linux64&lang=en-US" \
| tar -C /usr/local/ -jx && \
ln -s /usr/local/firefox/firefox /usr/bin/firefox && \
echo "exclude=firefox" >>/etc/dnf/dnf.conf
# install geckodriver
RUN url=$( curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep -Poh 'https.*linux64\.tar\.gz(?!\.)' ) && \
curl -sL "$url" | tar -C /usr/bin/ -xz
# clean up
RUN dnf clean all
# install the application requirements
# copy the virtualenv from the build image
COPY --from=build /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
@ -67,12 +61,26 @@ COPY setup.py requirements.txt requirements-dev.txt LICENSE.txt ./
RUN pip3 install --editable .
# install the config files
COPY vasl_templates/webapp/config/logging.yaml.example ./vasl_templates/webapp/config/logging.yaml
COPY docker/config/ ./vasl_templates/webapp/config/
# create a new user
# NOTE: It would be nice to just specify the UID/GID in the "docker run" command, but VASSAL has problems
# if there is no user :-/ We could specify these here, but that would bake them into the image.
# In general, this is not a problem, since the application doesn't need to access files outside the container,
# but if the user wants to e.g. keep the cached scenario index files outside the container, and they are
# running with a non-default UID/GID, they will have to manage permissions themselves. Sigh...
RUN useradd --create-home app
USER app
# FUDGE! We need this to stop spurious warning messages:
# Fork support is only compatible with the epoll1 and poll polling strategies
# Setting the verbosity to ERROR should suppress these, but doesn't :-/
# https://github.com/grpc/grpc/issues/17253
# https://github.com/grpc/grpc/blob/master/doc/environment_variables.md
ENV GRPC_VERBOSITY=NONE
# run the application
EXPOSE 5010
COPY docker/run.sh ./
CMD ./run.sh

@ -1,16 +1,14 @@
# VASL Templates
<a href="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/hill-621.png" target="_blank">
<img src="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/hill-621.small.png" width="200" align="right" hspace="10">
</a>
[<img src="vasl_templates/webapp/static/help/images/hill-621.small.png" width="200" align="right" hspace="10">](vasl_templates/webapp/static/help/images/hill-621.png)
*VASL Templates* makes it easy to set up attractive VASL scenarios, with loads of useful information embedded to assist with game play.
Simply enter the scenario information into the UI, and the program will generate HTML snippets that you can transfer into VASL labels in your scenario.
<img src="https://github.com/pacman-ghost/vasl-templates/raw/master/vasl_templates/webapp/static/help/images/ob_setup.png" width="200">
[<img src="vasl_templates/webapp/static/help/images/ob_setup.png" width="200">](vasl_templates/webapp/static/help/images/ob_setup.png)
You can find more examples of the program in action [here](https://github.com/pacman-ghost/vasl-templates/tree/master/examples/).
You can find more examples of the program in action [here](examples/).
### Documentation

@ -4,8 +4,8 @@ import os
import threading
import json
import re
import logging
import tempfile
import logging
import urllib.request
from urllib.error import URLError
import pytest
@ -42,7 +42,7 @@ def pytest_addoption( parser ):
help="Run the tests headless."
)
parser.addoption(
"--window-size", action="store", dest="window_size", default="1000x700",
"--window-size", action="store", dest="window_size", default="1020x700",
help="Browser window size."
)
@ -70,6 +70,13 @@ def pytest_configure( config ):
import vasl_templates.webapp.tests
vasl_templates.webapp.tests.pytest_options = config.option
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@pytest.fixture( scope="session" )
def monkeypatch():
"""Override the default monkeypatch fixture."""
assert False, "Don't use monkeypatch!" # it won't work when testing against a remote server
# ---------------------------------------------------------------------
_webapp = None
@ -100,7 +107,7 @@ def _make_webapp():
if webapp_url and not webapp_url.startswith( "http://" ):
webapp_url = "http://" + webapp_url
app.base_url = webapp_url if webapp_url else "http://localhost:{}".format( FLASK_WEBAPP_PORT )
logging.disable( logging.CRITICAL )
_disable_console_logging()
# initialize
# WTF?! https://github.com/pallets/flask/issues/824
@ -136,7 +143,7 @@ def _make_webapp():
# This means that the webapp doesn't get a chance to shutdown properly (in particular,
# clean up the gRPC service), but since we send an EndTests message at the of each test,
# the remote server gets a chance to clean up then. It's not perfect (e.g. if the tests fail
# or otherwise finish eearly before they get a chance to send the EndTests message), but
# or otherwise finish early before they get a chance to send the EndTests message), but
# we can live with it.
thread = threading.Thread(
target = lambda: app.run( host="0.0.0.0", port=FLASK_WEBAPP_PORT, use_reloader=False ),
@ -147,8 +154,9 @@ def _make_webapp():
def is_ready():
"""Try to connect to the webapp server."""
try:
resp = urllib.request.urlopen( app.url_for("ping") ).read()
assert resp.startswith( b"pong: " )
url = app.url_for( "ping" )
with urllib.request.urlopen( url ) as resp:
assert resp.read().startswith( b"pong: " )
return True
except URLError:
return False
@ -158,20 +166,31 @@ def _make_webapp():
# set up control of the remote webapp server
try:
resp = json.load(
urllib.request.urlopen( app.url_for( "get_control_tests" ) )
)
url = app.url_for( "get_control_tests" )
with urllib.request.urlopen( url ) as resp:
resp_data = json.load( resp )
except urllib.error.HTTPError as ex:
if ex.code == 404:
raise RuntimeError( "Can't get the test control port - has remote test control been enabled?" ) from ex
raise
port_no = resp.get( "port" )
port_no = resp_data.get( "port" )
if not port_no:
raise RuntimeError( "The webapp server is not running the test control service." )
mo = re.search( r"^http://(.+):\d+$", app.base_url )
addr = "{}:{}".format( mo.group(1), port_no )
app.control_tests = ControlTests( addr )
# NOTE: We set the back-end webdriver to be the of the same type (Firefox or Chrome) as the browser
# being used to drive the tests, which, strictly speaking, doesn't make sense, since the two things
# don't have anything to do with each other. However, this is a convenient way to switch the backend
# webdriver's and exercise both of them. The webdriver binary must be on the path, but if it's not,
# we won't have even got this far, since it needs to be there to drive the browser.
# NOTE: This will have no effect if we're talking to a remote server, but we can live with that.
if _pytest_options.webdriver == "firefox":
app.config[ "WEBDRIVER_PATH" ] = "geckodriver"
elif _pytest_options.webdriver == "chrome":
app.config[ "WEBDRIVER_PATH" ] = "chromedriver"
return app
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -179,7 +198,7 @@ def _make_webapp():
@pytest.fixture( scope="session" )
def test_client():
"""Return a test client that can be used to connect to the webapp."""
logging.disable( logging.CRITICAL )
_disable_console_logging()
return app.test_client()
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -197,27 +216,17 @@ def webdriver( request ):
# initialize
driver = request.config.getoption( "--webdriver" )
from selenium import webdriver as wb
log_fname = os.path.join( tempfile.gettempdir(), "webdriver-pytest.log" )
if driver == "firefox":
options = wb.FirefoxOptions()
options.headless = _pytest_options.headless
driver = wb.Firefox(
options = options,
service_log_path = os.path.join( tempfile.gettempdir(), "geckodriver.log" )
)
service = wb.firefox.service.Service( log_path=log_fname )
driver = wb.Firefox( options=options, service=service )
elif driver == "chrome":
options = wb.ChromeOptions()
options.headless = _pytest_options.headless
options.add_argument( "--disable-gpu" )
driver = wb.Chrome( options=options )
elif driver == "ie":
# NOTE: IE11 requires a registry key to be set:
# https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration
options = wb.IeOptions()
if _pytest_options.headless:
raise RuntimeError( "IE WebDriver cannot be run headless." )
options.IntroduceInstabilityByIgnoringProtectedModeSettings = True
options.EnsureCleanSession = True
driver = wb.Ie( ie_options=options )
else:
raise RuntimeError( "Unknown webdriver: {}".format( driver ) )
@ -230,3 +239,19 @@ def webdriver( request ):
yield driver
finally:
driver.quit()
# ---------------------------------------------------------------------
def _disable_console_logging():
"""Disable Python logging to the console.
We do this when running tests because:
(1) pytest's output is voluminous enough without including our stuff in there as well (and it tends to be
not that helpful, anyway)
(2) pytest captures all output and shows it when the test ends i.e. we don't get to see messages in real-time.
"""
for logger in utils.get_all_loggers():
# NOTE: FileHandler derives from StreamHandler, and we want to keep those, so we can't use isinstance().
handlers = [ h for h in logger.handlers if type( h ) is logging.StreamHandler ] #pylint: disable=unidiomatic-typecheck
for h in handlers:
logger.removeHandler( h )

@ -0,0 +1 @@
logging.yaml

@ -1,43 +0,0 @@
version: 1
formatters:
standard:
format: "%(asctime)s.%(msecs)03d | %(message)s"
datefmt: "%H:%M:%S"
handlers:
console:
class: "logging.StreamHandler"
formatter: "standard"
stream: "ext://sys.stdout"
file:
class: "logging.FileHandler"
formatter: "standard"
filename: "/tmp/vasl-templates.log"
mode: "w"
loggers:
werkzeug:
level: "WARNING"
handlers: [ "file" ]
vasl_mod:
level: "WARNING"
handlers: [ "file" ]
update_vsav:
level: "WARNING"
handlers: [ "file" ]
analyze_vsav:
level: "WARNING"
handlers: [ "file" ]
analyze_vlog:
level: "WARNING"
handlers: [ "file" ]
webdriver:
level: "WARNING"
handlers: [ "file" ]
downloads:
level: "WARNING"
handlers: [ "file" ]
control_tests:
level: "INFO"
handlers: [ "console", "file" ]

@ -2,5 +2,5 @@
IS_CONTAINER = 1
JAVA_PATH = /usr/bin/jdk-15.0.1/bin/java
JAVA_PATH = /usr/bin/jdk-17.0.2/bin/java
WEBDRIVER_PATH = /usr/bin/geckodriver

@ -1,16 +1,12 @@
{
"SCENARIO_NAME": "Hill 621",
"SCENARIO_ID": "ASL E",
"SCENARIO_LOCATION": "Near Minsk, Russia",
"COMPASS": "right",
"SCENARIO_DATE": "1944-07-01",
"SCENARIO_WIDTH": "",
"PLAYER_1_DESCRIPTION": "Retreating elements of 170th Infantry Division",
"PLAYER_2_DESCRIPTION": "Elements of 5th Guards Army",
"ASA_ID": "56512",
"ROAR_ID": "129",
"PLAYERS_WIDTH": "",
"VICTORY_CONDITIONS_WIDTH": "240px",
"SSR_WIDTH": "500px",
"VICTORY_CONDITIONS_WIDTH": "",
"SSR_WIDTH": "400px",
"OB_VEHICLES_WIDTH_1": "",
"OB_VEHICLES_MA_NOTES_WIDTH_1": "300px",
"OB_ORDNANCE_WIDTH_1": "",
@ -19,7 +15,12 @@
"OB_VEHICLES_MA_NOTES_WIDTH_2": "300px",
"OB_ORDNANCE_WIDTH_2": "",
"OB_ORDNANCE_MA_NOTES_WIDTH_2": "300px",
"VICTORY_CONDITIONS": "The Russians win at Game End if they Control &ge; five Level 3 hill hexes on Board 2.",
"SCENARIO_NAME": "Hill 621",
"SCENARIO_ID": "ASL E",
"SCENARIO_LOCATION": "Near Minsk, Russia",
"PLAYER_1_DESCRIPTION": "Retreating elements of 170th Infantry Division",
"PLAYER_2_DESCRIPTION": "Elements of 5th Guards Army",
"VICTORY_CONDITIONS": "The Russians win at Game End if they Control<br>≥ five Level 3 hill hexes on Board 2.",
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "russian",
"PLAYER_1_ELR": "4",
@ -27,6 +28,15 @@
"PLAYER_2": "german",
"PLAYER_2_ELR": "3",
"PLAYER_2_SAN": "4",
"TURN_TRACK": {
"NTURNS": "10",
"WIDTH": "",
"VERTICAL": false,
"SHADING": "",
"REINFORCEMENTS_1": "2,5",
"REINFORCEMENTS_2": "1,2,4,5,8",
"SWAP_PLAYERS": false
},
"SSR": [
"EC are Moderate, with no wind at start.",
"After \"At Start\" placement, each German infantry unit must take a TC. The only possible consequence of failure is that the unit must begin the scenario broken. Those units which break during this pre-game TC are not subject to DM in the initial German RPh.",
@ -106,7 +116,7 @@
],
"SCENARIO_NOTES": [
{
"caption": "Download the scenario card from <a href=\"http://www.multimanpublishing.com/Support/ASLASLSK/ASLOfficialDownloads/tabid/109/Default.aspx\">Multi-Man Publishing</a> (ASL Classic pack).",
"caption": "Download the scenario card from <a href=\"https://mmpgamers.com/asl-downloads-ezp-3#scenarios\">Multi-Man Publishing</a> (ASL Classic pack).",
"width": "300px",
"id": 1
}
@ -173,7 +183,7 @@
"id": 2
}
],
"_app_version": "v1.3",
"_last_update_time": "2020-09-27T04:13:08.719Z",
"_app_version": "v1.10",
"_last_update_time": "2022-09-12T02:46:18.035Z",
"_creation_time": "2020-09-27T03:46:56.089Z"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 MiB

After

Width:  |  Height:  |  Size: 3.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 109 KiB

@ -1,15 +1,11 @@
{
"SCENARIO_NAME": "Hube's Pocket",
"SCENARIO_ID": "ASL G",
"SCENARIO_LOCATION": "Near Buchach, Southern Russia",
"COMPASS": "down",
"SCENARIO_DATE": "1944-04-06",
"SCENARIO_WIDTH": "",
"PLAYER_1_DESCRIPTION": "Advance elements of 5th Tank Corps",
"PLAYER_2_DESCRIPTION": "10th SS Panzer Division \"Frundsberg\" and the First Panzer Army ",
"ASA_ID": "56514",
"ROAR_ID": "131",
"PLAYERS_WIDTH": "",
"VICTORY_CONDITIONS_WIDTH": "320px",
"VICTORY_CONDITIONS_WIDTH": "",
"SSR_WIDTH": "330px",
"OB_VEHICLES_WIDTH_1": "",
"OB_VEHICLES_MA_NOTES_WIDTH_1": "300px",
@ -19,7 +15,12 @@
"OB_VEHICLES_MA_NOTES_WIDTH_2": "300px",
"OB_ORDNANCE_WIDTH_2": "",
"OB_ORDNANCE_MA_NOTES_WIDTH_2": "300px",
"VICTORY_CONDITIONS": "The Germans win immediately by exiting &ge; 10 vehicles <br>\noff the west edge in either one or two Convoys (see SSR 4).",
"SCENARIO_NAME": "Hube's Pocket",
"SCENARIO_ID": "ASL G",
"SCENARIO_LOCATION": "Near Buchach, Southern Russia",
"PLAYER_1_DESCRIPTION": "Advance elements of 5th Tank Corps",
"PLAYER_2_DESCRIPTION": "10th SS Panzer Division \"Frundsberg\" and the First Panzer Army",
"VICTORY_CONDITIONS": "The Germans win immediately by exiting ≥ 10 vehicles <br>\noff the west edge in either one or two Convoys (see SSR 4).",
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "german",
"PLAYER_1_ELR": "4",
@ -27,6 +28,15 @@
"PLAYER_2": "russian",
"PLAYER_2_ELR": "3",
"PLAYER_2_SAN": "2",
"TURN_TRACK": {
"NTURNS": "14",
"WIDTH": "5",
"VERTICAL": false,
"SHADING": "",
"REINFORCEMENTS_1": "1,5",
"REINFORCEMENTS_2": "1",
"SWAP_PLAYERS": true
},
"SSR": [
"The SPW 251/sMG inherent HS is a 3-4-8.",
"German inherent crews have a morale of 9.",
@ -84,7 +94,7 @@
],
"SCENARIO_NOTES": [
{
"caption": "Download the scenario card from <a href=\"http://www.multimanpublishing.com/Support/ASLASLSK/ASLOfficialDownloads/tabid/109/Default.aspx\">Multi-Man Publishing</a> (ASL Classic pack).",
"caption": "Download the scenario card from <a href=\"https://mmpgamers.com/asl-downloads-ezp-3#scenarios\">Multi-Man Publishing</a> (ASL Classic pack).",
"width": "",
"id": 1
}
@ -110,7 +120,7 @@
],
"OB_NOTES_1": [],
"OB_NOTES_2": [],
"_app_version": "v1.3",
"_last_update_time": "2020-09-27T04:33:18.643Z",
"_app_version": "v1.10",
"_last_update_time": "2022-09-12T02:22:47.511Z",
"_creation_time": "2020-09-27T04:11:07.200Z"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 79 KiB

@ -4,4 +4,4 @@ This directory contains examples of *VASL Templates* in action, with the `.json`
The online versions contain images that will be loaded from the internet, which looks much better, but there will be a short delay when you open the scenario in VASSAL as the images are downloaded.
These scenarios were taken from Multi-Man Publishing's [*ASL Classic* scenario pack](http://www.multimanpublishing.com/Support/ASLASLSK/ASLOfficialDownloads/tabid/109/Default.aspx).
These scenarios were taken from Multi-Man Publishing's [*ASL Classic* scenario pack](https://mmpgamers.com/asl-downloads-ezp-3#scenarios).

@ -1,15 +1,11 @@
{
"SCENARIO_NAME": "The Streets Of Stalingrad",
"SCENARIO_ID": "ASL C",
"SCENARIO_LOCATION": "Stalingrad, Russia",
"COMPASS": "up",
"SCENARIO_DATE": "1942-10-06",
"SCENARIO_WIDTH": "",
"PLAYER_1_DESCRIPTION": "308th Rifle Division / 295th Rifle Division / 2nd Battalion, 37th Guards Division",
"PLAYER_2_DESCRIPTION": "389th Infantry Division",
"ASA_ID": "56510",
"ROAR_ID": "127",
"PLAYERS_WIDTH": "",
"VICTORY_CONDITIONS_WIDTH": "400px",
"VICTORY_CONDITIONS_WIDTH": "450px",
"SSR_WIDTH": "500px",
"OB_VEHICLES_WIDTH_1": "",
"OB_VEHICLES_MA_NOTES_WIDTH_1": "300px",
@ -19,7 +15,12 @@
"OB_VEHICLES_MA_NOTES_WIDTH_2": "300px",
"OB_ORDNANCE_WIDTH_2": "",
"OB_ORDNANCE_MA_NOTES_WIDTH_2": "300px",
"VICTORY_CONDITIONS": "Victory is based upon satisfying the Victory Conditions of Scenarios A and B:\n<ul style=\"margin:0 0 10px 10px;\">\n<li> If each side fulfills one Victory Condition, the game is a draw.\n<li> If a player fulfills one Victory Condition and draws the other, he wnis.\n<li> A decisive victory is achieved when a player fulfills both Victory Conditions.\n</ul>\n\n<p> <b>Scenario A:</b> The Russians win at Game End if they Control &ge; 2 more buildings initially occupied by the Germans than they lose of their own initially-held stone buildings to German Control, and/or have a favorable 3:1 ratio of unbroken squad-equivalents.\n<p> <b>Scenario B:</b> At Game End, the player with undisputed control of at least 6 hexes of building X3 wins. A hex containing a Melee is controlled by neither player. If only one player has an unbroken unit in the building at Game End, that player is the winner. Any other result is a draw.\n</ul>",
"SCENARIO_NAME": "The Streets Of Stalingrad",
"SCENARIO_ID": "ASL C",
"SCENARIO_LOCATION": "Stalingrad, Russia",
"PLAYER_1_DESCRIPTION": "308th Rifle Division / 295th Rifle Division / 2nd Battalion, 37th Guards Division",
"PLAYER_2_DESCRIPTION": "389th Infantry Division",
"VICTORY_CONDITIONS": "Victory is based upon satisfying the Victory Conditions of Scenarios A and B:\n<ul style=\"margin:0 0 10px 10px;\">\n<li> If each side fulfills one Victory Condition, the game is a draw.\n</li><li> If a player fulfills one Victory Condition and draws the other, he wnis.\n</li><li> A decisive victory is achieved when a player fulfills both Victory Conditions.\n</li></ul>\n\n<p> <b>Scenario A:</b> The Russians win at Game End if they Control ≥ 2 more buildings initially occupied by the Germans than they lose of their own initially-held stone buildings to German Control, and/or have a favorable 3:1 ratio of unbroken squad-equivalents.\n</p><p> <b>Scenario B:</b> At Game End, the player with undisputed control of at least 6 hexes of building X3 wins. A hex containing a Melee is controlled by neither player. If only one player has an unbroken unit in the building at Game End, that player is the winner. Any other result is a draw.\n</p>",
"SCENARIO_THEATER": "ETO",
"PLAYER_1": "russian",
"PLAYER_1_ELR": "3",
@ -27,6 +28,15 @@
"PLAYER_2": "german",
"PLAYER_2_ELR": "4",
"PLAYER_2_SAN": "6",
"TURN_TRACK": {
"NTURNS": "7",
"WIDTH": "",
"VERTICAL": false,
"SHADING": "",
"REINFORCEMENTS_1": "2",
"REINFORCEMENTS_2": "3",
"SWAP_PLAYERS": false
},
"SSR": [
"Roll a die to determine who moves first.",
"Set up the forces of Scenario A prior to placing the units of Scenario B.",
@ -61,7 +71,7 @@
],
"SCENARIO_NOTES": [
{
"caption": "Download the scenario card from <a href=\"http://www.multimanpublishing.com/Support/ASLASLSK/ASLOfficialDownloads/tabid/109/Default.aspx\">Multi-Man Publishing</a> (ASL Classic pack).",
"caption": "Download the scenario card from <a href=\"https://mmpgamers.com/asl-downloads-ezp-3#scenarios\">Multi-Man Publishing</a> (ASL Classic pack).",
"width": "",
"id": 1
}
@ -157,7 +167,7 @@
],
"OB_NOTES_1": [],
"OB_NOTES_2": [],
"_app_version": "v1.3",
"_last_update_time": "2020-09-27T04:46:21.803Z",
"_app_version": "v1.10",
"_last_update_time": "2022-09-12T02:58:13.237Z",
"_creation_time": "2020-09-27T04:44:48.473Z"
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 902 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 61 KiB

@ -19,10 +19,167 @@ BASE_DIR = os.path.split( os.path.abspath(__file__) )[ 0 ]
MAIN_SCRIPT = "vasl_templates/main.py"
APP_ICON = os.path.join( BASE_DIR, "vasl_templates/webapp/static/images/app.ico" )
TARGET_NAMES = {
"win32": "vasl-templates.exe",
}
DEFAULT_TARGET_NAME = "vasl-templates"
# ---------------------------------------------------------------------
def main( args ): #pylint: disable=too-many-locals
"""Main processing."""
# parse the command-line options
output_fname = None
no_loader = False
work_dir = None
cleanup = True
opts,args = getopt.getopt( sys.argv[1:], "o:w:", ["output=","no-loader","work=","no-clean"] )
for opt, val in opts:
if opt in ["-o","--output"]:
output_fname = val.strip()
elif opt in ["--no-loader"]:
no_loader = True
elif opt in ["-w","--work"]:
work_dir = val.strip()
elif opt in ["--no-clean"]:
cleanup = False
else:
raise RuntimeError( "Unknown argument: {}".format( opt ) )
if not output_fname:
raise RuntimeError( "No output file was specified." )
# figure out where to locate our work directories
if work_dir:
work_dir = os.path.abspath( work_dir )
build_dir = os.path.join( work_dir, "build" )
if os.path.isdir( build_dir ):
shutil.rmtree( build_dir )
dist_dir = os.path.join( work_dir, "dist" )
if os.path.isdir( dist_dir ):
shutil.rmtree( dist_dir )
else:
build_dir = tempfile.mkdtemp()
dist_dir = tempfile.mkdtemp()
# figure out the format of the release archive
formats = { ".zip": "zip", ".tar.gz": "gztar", ".tar.bz": "bztar", ".tar": "tar" }
output_fmt = None
for extn,fmt in formats.items():
if output_fname.endswith( extn ):
output_fmt = fmt
output_fname2 = output_fname[:-len(extn)]
break
if not output_fmt:
raise RuntimeError( "Unknown release archive format: {}".format( os.path.split(output_fname)[1] ) )
# configure pyinstaller
# NOTE: Using UPX gave ~25% saving on Windows, but failed to run because of corrupt DLL's :-/
target_name = make_target_name( "vasl-templates" )
args = [
"--distpath", dist_dir,
"--workpath", build_dir,
"--specpath", build_dir,
"--onefile",
"--name", target_name,
]
args.extend( [ "--add-data",
os.path.join( BASE_DIR, "vassal-shim/release/vassal-shim.jar" + os.pathsep + "vasl_templates/webapp" )
] )
# NOTE: We also need to include the config/ and data/ subdirectories, but we would like to
# make them available to the user, so we include them ourself in the final release archive.
def map_dir( src, dest ): #pylint: disable=missing-docstring
args.extend( [ "--add-data",
os.path.join( BASE_DIR, src + os.pathsep + dest )
] )
map_dir( "vasl_templates/ui", "vasl_templates/ui" )
map_dir( "vasl_templates/resources", "vasl_templates/resources" )
map_dir( "vasl_templates/webapp/static", "vasl_templates/webapp/static" )
map_dir( "vasl_templates/webapp/templates", "vasl_templates/webapp/templates" )
if sys.platform == "win32":
args.append( "--noconsole" )
args.extend( [ "--icon", APP_ICON ] )
# NOTE: These files are not always required but it's probably safer to always include them.
import sysconfig
dname = os.path.join( sysconfig.get_path("platlib") , "PyQt5/Qt5/bin" )
args.extend( [ "--add-binary", os.path.join(dname,"libEGL.dll") + os.pathsep + "PyQt5/Qt/bin" ] )
args.extend( [ "--add-binary", os.path.join(dname,"libGLESv2.dll") + os.pathsep + "PyQt5/Qt/bin" ] )
args.append( MAIN_SCRIPT )
# freeze the application
start_time = time.time()
os.chdir( BASE_DIR )
run_pyinstaller( args ) # nb: this doesn't return any indication if it worked or not :-/
# add extra files to the distribution
def ignore_files( dname, fnames ): #pylint: disable=redefined-outer-name
"""Return files to ignore during copytree()."""