Skip to content

Commit

Permalink
names: option to output only certain missing ids
Browse files Browse the repository at this point in the history
  • Loading branch information
bnnm committed Jul 3, 2022
1 parent be44748 commit 1402229
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion wwiser/names/wnames.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self):
self._disable_fuzzy = False
self._classify = False
self._classify_bank = False

self._hashtypes_missing = None # print only certain hashtypes

def set_gamename(self, gamename):
self._gamename = gamename #path
Expand Down Expand Up @@ -674,6 +674,9 @@ def _parse_lst(self, infile):
self._classify = True
if line.startswith('#@classify-bank'): #implicit: sets the above
self._classify_bank = True
if line.startswith('#@hashtypes-missing'):
line = line.replace('#@hashtypes-missing', '')
self._hashtypes_missing = [item.lower().strip() for item in line.split()]
continue

match = pattern_1.match(line)
Expand Down Expand Up @@ -819,6 +822,8 @@ def save_lst(self, basename=None, path=None, save_all=False, save_companion=Fals
lines.append('#@classify-bank')
elif self._classify:
lines.append('#@classify')
elif self._hashtypes_missing:
lines.append('#@hashtypes-missing ' + ' '.join(self._hashtypes_missing))

names = self._names.values()
for row in names:
Expand Down Expand Up @@ -928,6 +933,9 @@ def _include_lines(self, save_missing, lines, types_lines, hashtype, bank):


def _include_missing(self, lines, hashtype, bank, header=False):
if self._hashtypes_missing and hashtype not in self._hashtypes_missing:
return

banks = self._missing.get(hashtype)
if not banks:
return
Expand Down
2 changes: 1 addition & 1 deletion wwiser/wversion.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#autogenerated on build
WWISER_VERSION = "v20220613"
WWISER_VERSION = "v20220703"

0 comments on commit 1402229

Please sign in to comment.