Tweaked how search aliases are configured.

master
Pacman Ghost 4 years ago
parent 908455ebc5
commit 97e3cd1812
  1. 10
      asl_articles/config/app.cfg
  2. 2
      asl_articles/search.py
  3. 2
      asl_articles/tests/test_search.py

@ -7,7 +7,7 @@
[Search aliases]
asl = Advanced Squad Leader
mmp = Multi-Man Publishing ; Multiman Publishing
mmp = Multi-Man Publishing = Multiman Publishing
ah = Avalon Hill
vftt = View From The Trenches
dftb = Dispatches From The Bunker
@ -18,7 +18,7 @@ rb = red barricades
votg = valor of the guards
kgp = kampfgrupper peiper
kgs = kampfgrupper scherer
brt = br:t ; blood reef tarawa
brt = br:t = blood reef tarawa
pb = pegasus bridge
dc = demo charge
@ -33,14 +33,14 @@ cc = close combat
thh = tank-hunter hero
scw = shaped-charge weapon
sw = support weapon
mg = machinegun ; machine gun
mg = machinegun = machine gun
ammo = ammunition
lc = landing craft
ht = halftrack
wa = wall advantage
firelane = fire-lane ; fire lane
firegroup = fire-group ; fire group
firelane = fire-lane = fire lane
firegroup = fire-group = fire group
armor = armour
humor = humour

@ -413,7 +413,7 @@ def _load_search_aliases( aliases ):
"""Load the search aliases."""
search_aliases = {}
for row in aliases:
vals = itertools.chain( [row[0]], row[1].split(";") )
vals = itertools.chain( [row[0]], row[1].split("=") )
vals = [ v.strip().lower() for v in vals ]
_logger.debug( "- %s", vals )
for v in vals:

@ -445,7 +445,7 @@ def test_make_fts_query_string():
# initialize
search_aliases = _load_search_aliases( [
( "mmp", "Multi-Man Publishing ; Multiman Publishing" )
( "mmp", "Multi-Man Publishing = Multiman Publishing" )
] )
def do_test( query, expected ):

Loading…
Cancel
Save