mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-13 20:48:02 +01:00
fix dictionary sum checking server-side
This commit is contained in:
parent
b3a3d38ca4
commit
3c1a748272
2 changed files with 10 additions and 5 deletions
|
@ -98,11 +98,11 @@ def languageCodeFor( lang ):
|
||||||
|
|
||||||
def getInternalSum( filePath ):
|
def getInternalSum( filePath ):
|
||||||
filePath = k_filebase + "and_wordlists/" + filePath
|
filePath = k_filebase + "and_wordlists/" + filePath
|
||||||
proc = subprocess.Popen(['/usr/bin/perl',
|
proc = subprocess.Popen(['/usr/bin/python3',
|
||||||
'--',
|
'--',
|
||||||
k_filebase + 'xw4/dawg2dict.pl',
|
k_filebase + 'xw4/dawg2dict.py',
|
||||||
'-get-sum',
|
'--get-sum',
|
||||||
'-dict', filePath ],
|
'--dict', filePath ],
|
||||||
stdout = subprocess.PIPE,
|
stdout = subprocess.PIPE,
|
||||||
stderr = subprocess.PIPE)
|
stderr = subprocess.PIPE)
|
||||||
results = proc.communicate()
|
results = proc.communicate()
|
||||||
|
|
|
@ -160,6 +160,10 @@ def process(args):
|
||||||
md5Sum = getNullTermParam(header)
|
md5Sum = getNullTermParam(header)
|
||||||
print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr )
|
print( 'header: read sum: {}'.format(md5Sum), file=sys.stderr )
|
||||||
|
|
||||||
|
if args.GET_SUM:
|
||||||
|
print( '{}'.format(md5Sum), file=sys.stdout )
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
nodeSize = 0
|
nodeSize = 0
|
||||||
isUTF8 = False
|
isUTF8 = False
|
||||||
flags &= ~DICT_SYNONYMS_MASK
|
flags &= ~DICT_SYNONYMS_MASK
|
||||||
|
@ -232,7 +236,8 @@ def mkParser():
|
||||||
action = 'store_true', help = 'write tile metadata to stdout')
|
action = 'store_true', help = 'write tile metadata to stdout')
|
||||||
parser.add_argument('--dump-msg', dest = 'DUMP_MSG', default = False,
|
parser.add_argument('--dump-msg', dest = 'DUMP_MSG', default = False,
|
||||||
action = 'store_true', help = 'write header user-visible message to stdout')
|
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>
|
# [-raw | -json] [-get-sum] [-get-desc] -dict <xwdORpdb>
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue