Added the Swedish nationality.

master v1.9
Pacman Ghost 2 years ago
parent cde6649918
commit 786f35be9a
  1. BIN
      chapter-h/chapter-h-placeholders.zip
  2. 3
      vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt
  3. 11
      vasl_templates/webapp/data/default-template-pack/national-capabilities.json
  4. 5
      vasl_templates/webapp/data/default-template-pack/nationalities.json
  5. 26
      vasl_templates/webapp/data/ordnance/swedish.json
  6. BIN
      vasl_templates/webapp/static/images/flags/swedish.png
  7. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1940.txt
  8. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1941.txt
  9. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1942.txt
  10. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1943.txt
  11. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1944.txt
  12. 10
      vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1945.txt
  13. 3
      vasl_templates/webapp/tests/fixtures/vasl-pieces-6.6.4.txt
  14. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1940.txt
  15. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1941.txt
  16. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1942.txt
  17. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1943.txt
  18. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1944.txt
  19. 7
      vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1945.txt
  20. 11
      vasl_templates/webapp/tests/test_counters.py
  21. 6
      vasl_templates/webapp/tests/test_vehicles_ordnance.py
  22. 4
      vasl_templates/webapp/tests/test_vo_notes.py
  23. 2
      vasl_templates/webapp/tests/test_vo_reports.py
  24. 4
      vasl_templates/webapp/vasl_mod.py

@ -1468,6 +1468,9 @@ slovakian/vehicles/20.png
slovakian/vehicles/21.png
slovakian/vehicles/22.png
slovakian/vehicles/23.png
swedish/ordnance/1.png
swedish/ordnance/2.png
swedish/ordnance/3.png
thai/ordnance/adf-bj/4.png
thai/ordnance/adf-bj/5.png
thai/ordnance/adf-bj/8.png

@ -109,6 +109,17 @@
]
},
"swedish": {
"th_color": [ "Red", "[EXC: MG]" ],
"oba": [ "6B", "3R"],
"hob_drm": "0 DRM",
"notes": [
"1<sup>st</sup> Line Battle Hardening &rarr; Fanatic",
"Allied Troops Captured Use penalties NA",
"Extreme Winter effects NA"
]
},
"axis-minor": {
"th_color": "Red",
"oba": [ "6B", "3R" ], "oba_access": "&le; 1",

@ -55,6 +55,11 @@
"ob_colors": [ "#edefef","#ced3d3", "#ced3d3" ]
},
"swedish": {
"display_name": "Swedish",
"ob_colors": [ "#89bfe9","#699fc9", "#699fc9" ]
},
"japanese": {
"display_name": "Japanese",
"ob_colors": [ "#fff200","#ffdb00", "#ffdb00" ]

@ -0,0 +1,26 @@
[
{ "name": "81mm Granatkastare m/29",
"type": "MTR",
"capabilities2": { "s": 8 },
"comments": [ "QSU" ],
"note_number": "1",
"id": "swe/o:000",
"gpid": 13832
},
{ "name": "37mm Pansarv&auml;rnskanon m/38",
"type": "AT",
"comments": [ "QSU" ],
"note_number": "2",
"id": "swe/o:001",
"gpid": 13835
},
{ "name": "8.4cm Feltkanon m/1887",
"type": "ART",
"comments": [ "QSU", "No Gunshield", "Acquisition NA" ],
"note_number": "3",
"id": "swe/o:002",
"gpid": 13836
}
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 981 B

@ -0,0 +1,10 @@
=== swedish (ETO 1940) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -0,0 +1,10 @@
=== swedish (ETO 1941) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -0,0 +1,10 @@
=== swedish (ETO 1942) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -0,0 +1,10 @@
=== swedish (ETO 1943) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -0,0 +1,10 @@
=== swedish (ETO 1944) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -0,0 +1,10 @@
=== swedish (ETO 1945) ===
-
HoB: 0 DRM
Red TH# [EXC: MG]
OBA: 6B 3R -
* 1st Line Battle Hardening → Fanatic
* Allied Troops Captured Use penalties NA
* Extreme Winter effects NA

@ -1285,6 +1285,9 @@ GPID Name Front images
12687 OML 2in MTR (KW) br/brMTR.gif br/brMTRb.gif
12689 60* MTR M2 (KW) am/amMTR.gif am/amMTRb.gif
12730 IP Carrier AOV br/vehicles/ipcaov.gif
13832 81* MTR sv/gun/svMTR81s.gif sv/gun/svMTR81sb.gif
13835 37L AT sv/gun/svAT37L.gif sv/gun/svAT37Lb.gif
13836 84* ART sv/gun/svART84s.gif sv/gun/svART84sb.gif
3b5:10093 SL truck us/veh/usSearchlight(KFW).png
3b5:10114 57LL AT PTP obr. 43 cc/gun/ccAT57LL(KFW).png cc/gun/ccAT57LLm(KFW).png
3b5:10115 70* INF Type 92 cc/gun/ccINF70(KFW).png cc/gun/ccINF70m(KFW).png

@ -0,0 +1,7 @@
=== ordnance/swedish/1940 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -0,0 +1,7 @@
=== ordnance/swedish/1941 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -0,0 +1,7 @@
=== ordnance/swedish/1942 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -0,0 +1,7 @@
=== ordnance/swedish/1943 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -0,0 +1,7 @@
=== ordnance/swedish/1944 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -0,0 +1,7 @@
=== ordnance/swedish/1945 ===
Name Capabilities (effective) # Notes Comments
------------------------------- -------------- ------------- --- ------- -----------------------------------
81mm Granatkastare m/29 s8 s8 1 n/a QSU
37mm Pansarv&#228;rnskanon m/38 2 n/a QSU
8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA

@ -23,10 +23,15 @@ def test_counter_images( webapp, webdriver ): #pylint: disable=too-many-locals
# NOTE: This is ridiculously slow on Windows :-/
def check_images( gpids, check_front, check_back ): #pylint: disable=unused-argument
def check_images( vasl_version, gpids, check_front, check_back ): #pylint: disable=unused-argument
"""Check getting the front and back images for each counter."""
is_pre_vasl664 = vasl_version and compare_version_strings( vasl_version, "6.6.4" ) < 0
for gpid in gpids:
# FUDGE! These Swedish ordnance were only added in VASL 6.6.4.
if is_pre_vasl664 and gpid in [ "13832", "13835", "13836" ]:
continue
for side in ("front","back"):
url = webapp.url_for( "get_counter_image", gpid=gpid, side=side )
try:
@ -47,7 +52,7 @@ def test_counter_images( webapp, webdriver ): #pylint: disable=too-many-locals
fname = os.path.join( os.path.split(__file__)[0], "../static/images/missing-image.png" )
with open( fname, "rb" ) as fp:
missing_image_data = fp.read()
check_images( gpids,
check_images( None, gpids,
check_front = lambda code, data: code == 200 and data == missing_image_data,
check_back = lambda code, data: code == 200 and data == missing_image_data
)
@ -104,7 +109,7 @@ def test_counter_images( webapp, webdriver ): #pylint: disable=too-many-locals
assert False, "Report mismatch: {}".format( vasl_version )
# check each counter
check_images( gpids, check_front=_do_check_front, check_back=_do_check_back )
check_images( vasl_version, gpids, check_front=_do_check_front, check_back=_do_check_back )
assert not failed

@ -414,14 +414,12 @@ def test_common_vo( webapp, webdriver ): #pylint: disable=too-many-locals
# check if the nationality has any vehicles/ordnance
elem = find_child( "#ob_{}-add_1".format( vo_type ) )
if nat in ["thai","indonesian","anzac","burmese","filipino"]: # nb: these are in the BFP extension
if nat in ["thai","indonesian","anzac","burmese","filipino","partisan"]:
assert not elem.is_displayed()
continue
if nat == "kfw-cpva" and vo_type == "vehicles":
if (nat, vo_type) in [ ("kfw-cpva","vehicles"), ("swedish","vehicles") ]:
assert not elem.is_displayed()
continue
if nat == "partisan":
continue
elem.click()
# get the vehicles/ordnance

@ -598,7 +598,9 @@ def test_vo_notes_reports( webapp, webdriver ): #pylint: disable=too-many-locals
# get the next report
vo_notes, ma_notes, keys = get_vo_notes_report( webapp, webdriver, nat, vo_type )
if nat in ("burmese","filipino","partisan") \
or (nat,vo_type) in [ ("landing-craft","ordnance"), ("anzac","ordnance"), ("kfw-cpva","vehicles") ]:
or (nat,vo_type) in [
("landing-craft","ordnance"), ("anzac","ordnance"), ("kfw-cpva","vehicles"), ("swedish","vehicles")
]:
assert not vo_notes and not ma_notes and not keys
continue

@ -68,7 +68,7 @@ def test_vo_reports( webapp, webdriver ): #pylint: disable=too-many-locals
continue
results = get_vo_report( webapp, webdriver, vo_type, nat, "ETO", year, 1 )
if nat in ( "burmese", "filipino", "partisan" ) \
or ( nat, vo_type ) in [ ("anzac","ordnance"), ("kfw-cpva","vehicles") ]:
or ( nat, vo_type ) in [ ("anzac","ordnance"), ("kfw-cpva","vehicles"), ("swedish","vehicles") ]:
assert not results
continue

@ -381,7 +381,9 @@ class VaslMod:
return True
if val.startswith( "," ):
val = val[1:]
if val.startswith( ("ru/","ge/","am/","br/","it/","ja/","ch/","sh/","fr/","al/","ax/","hu/","fi/","nk/") ):
if val.startswith( (
"ru/", "ge/", "am/", "br/", "it/", "ja/", "ch/", "sh/", "fr/", "al/", "ax/", "hu/", "fi/", "nk/", "sv/"
) ):
return True
return False
fields = [ f for f in fields if is_image_path(f) ]

Loading…
Cancel
Save