diff --git a/chapter-h/chapter-h-placeholders.zip b/chapter-h/chapter-h-placeholders.zip index b124791..a20c51c 100644 Binary files a/chapter-h/chapter-h-placeholders.zip and b/chapter-h/chapter-h-placeholders.zip differ diff --git a/vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt b/vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt index d6a3a82..ed0dc72 100644 --- a/vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt +++ b/vasl_templates/tools/tests/fixtures/chapter-h-placeholders.txt @@ -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 diff --git a/vasl_templates/webapp/data/default-template-pack/national-capabilities.json b/vasl_templates/webapp/data/default-template-pack/national-capabilities.json index 90ad22f..7a02052 100644 --- a/vasl_templates/webapp/data/default-template-pack/national-capabilities.json +++ b/vasl_templates/webapp/data/default-template-pack/national-capabilities.json @@ -109,6 +109,17 @@ ] }, +"swedish": { + "th_color": [ "Red", "[EXC: MG]" ], + "oba": [ "6B", "3R"], + "hob_drm": "0 DRM", + "notes": [ + "1st Line Battle Hardening → Fanatic", + "Allied Troops Captured Use penalties NA", + "Extreme Winter effects NA" + ] +}, + "axis-minor": { "th_color": "Red", "oba": [ "6B", "3R" ], "oba_access": "≤ 1", diff --git a/vasl_templates/webapp/data/default-template-pack/nationalities.json b/vasl_templates/webapp/data/default-template-pack/nationalities.json index 7fabcdd..51965fe 100644 --- a/vasl_templates/webapp/data/default-template-pack/nationalities.json +++ b/vasl_templates/webapp/data/default-template-pack/nationalities.json @@ -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" ] diff --git a/vasl_templates/webapp/data/ordnance/swedish.json b/vasl_templates/webapp/data/ordnance/swedish.json new file mode 100644 index 0000000..2757b48 --- /dev/null +++ b/vasl_templates/webapp/data/ordnance/swedish.json @@ -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ä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 +} + +] diff --git a/vasl_templates/webapp/static/images/flags/swedish.png b/vasl_templates/webapp/static/images/flags/swedish.png new file mode 100644 index 0000000..c030b6b Binary files /dev/null and b/vasl_templates/webapp/static/images/flags/swedish.png differ diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1940.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1940.txt new file mode 100644 index 0000000..edbad76 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1940.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1941.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1941.txt new file mode 100644 index 0000000..87d5580 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1941.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1942.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1942.txt new file mode 100644 index 0000000..fec615f --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1942.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1943.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1943.txt new file mode 100644 index 0000000..d6fabee --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1943.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1944.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1944.txt new file mode 100644 index 0000000..377a5ee --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1944.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1945.txt b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1945.txt new file mode 100644 index 0000000..3dff117 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/nat-caps/swedish/1945.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/vasl-pieces-6.6.4.txt b/vasl_templates/webapp/tests/fixtures/vasl-pieces-6.6.4.txt index c0ad3b8..146e327 100644 --- a/vasl_templates/webapp/tests/fixtures/vasl-pieces-6.6.4.txt +++ b/vasl_templates/webapp/tests/fixtures/vasl-pieces-6.6.4.txt @@ -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 diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1940.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1940.txt new file mode 100644 index 0000000..8497c79 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1940.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1940 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1941.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1941.txt new file mode 100644 index 0000000..1328f66 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1941.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1941 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1942.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1942.txt new file mode 100644 index 0000000..5189517 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1942.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1942 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1943.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1943.txt new file mode 100644 index 0000000..7736230 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1943.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1943 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1944.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1944.txt new file mode 100644 index 0000000..eb650f5 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1944.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1944 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1945.txt b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1945.txt new file mode 100644 index 0000000..59bdd27 --- /dev/null +++ b/vasl_templates/webapp/tests/fixtures/vo-reports/ordnance/swedish/1945.txt @@ -0,0 +1,7 @@ +=== ordnance/swedish/1945 === + +Name Capabilities (effective) # Notes Comments +------------------------------- -------------- ------------- --- ------- ----------------------------------- +81mm Granatkastare m/29 s8 s8 1 n/a QSU +37mm Pansarvärnskanon m/38 2 n/a QSU +8.4cm Feltkanon m/1887 3 n/a QSU | No Gunshield | Acquisition NA diff --git a/vasl_templates/webapp/tests/test_counters.py b/vasl_templates/webapp/tests/test_counters.py index 0766b3a..bc5a397 100644 --- a/vasl_templates/webapp/tests/test_counters.py +++ b/vasl_templates/webapp/tests/test_counters.py @@ -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 diff --git a/vasl_templates/webapp/tests/test_vehicles_ordnance.py b/vasl_templates/webapp/tests/test_vehicles_ordnance.py index c569068..14073c7 100644 --- a/vasl_templates/webapp/tests/test_vehicles_ordnance.py +++ b/vasl_templates/webapp/tests/test_vehicles_ordnance.py @@ -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 diff --git a/vasl_templates/webapp/tests/test_vo_notes.py b/vasl_templates/webapp/tests/test_vo_notes.py index 786e0d8..c45af16 100644 --- a/vasl_templates/webapp/tests/test_vo_notes.py +++ b/vasl_templates/webapp/tests/test_vo_notes.py @@ -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 diff --git a/vasl_templates/webapp/tests/test_vo_reports.py b/vasl_templates/webapp/tests/test_vo_reports.py index 310bc87..0699272 100644 --- a/vasl_templates/webapp/tests/test_vo_reports.py +++ b/vasl_templates/webapp/tests/test_vo_reports.py @@ -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 diff --git a/vasl_templates/webapp/vasl_mod.py b/vasl_templates/webapp/vasl_mod.py index 3ffae97..c1462db 100644 --- a/vasl_templates/webapp/vasl_mod.py +++ b/vasl_templates/webapp/vasl_mod.py @@ -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) ]