fix dictionary sum checking server-side

This commit is contained in:
Eric House 2020-03-18 22:28:58 -07:00
parent b3a3d38ca4
commit 3c1a748272
2 changed files with 10 additions and 5 deletions

View file

@ -98,11 +98,11 @@ def languageCodeFor( lang ):
def getInternalSum( filePath ):
filePath = k_filebase + "and_wordlists/" + filePath
proc = subprocess.Popen(['/usr/bin/perl',
proc = subprocess.Popen(['/usr/bin/python3',
'--',
k_filebase + 'xw4/dawg2dict.pl',
'-get-sum',
'-dict', filePath ],
k_filebase + 'xw4/dawg2dict.py',
'--get-sum',
'--dict', filePath ],
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
results = proc.communicate()

View file

@ -160,6 +160,10 @@ def process(args):
md5Sum = getNullTermParam(header)
print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr )
if args.GET_SUM:
print( '{}'.format(md5Sum), file=sys.stdout )
sys.exit(0)
nodeSize = 0
isUTF8 = False
flags &= ~DICT_SYNONYMS_MASK
@ -232,7 +236,8 @@ def mkParser():
action = 'store_true', help = 'write tile metadata to stdout')
parser.add_argument('--dump-msg', dest = 'DUMP_MSG', default = False,
action = 'store_true', help = 'write header user-visible message to stdout')
parser.add_argument('--get-sum', dest = 'GET_SUM', default = False,
action = 'store_true', help = 'write md5sum to stdout')
# [-raw | -json] [-get-sum] [-get-desc] -dict <xwdORpdb>