(09-23-2020 09:22 PM)lingu Wrote: [ -> ]but it hasn't helped.
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 404,
"msg": "not found",
"children": [
]
}
[zhihao@limbo30-1 processed]$
i tested procone and it has some syntax error.
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
File "/thinker/globe/soft/bibo/procone.py", line 27
os.system(rid --insitu tycajson_pfn)
^
SyntaxError: invalid syntax
[sage2@g1b-2 ~]$
The param should be a string.
But os.system is not our preferred way to run a command. We use cmdline. So I changed it to
Code:
cmdline.runOrExit("rid --insitu tycajson_pfn")
After this is fixed, there is another error.
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
File "/thinker/globe/soft/bibo/procone.py", line 51
elif opt == "--reqtype"
^
SyntaxError: invalid syntax
[sage2@g1b-2 ~]$
Added ':'
Next error
Code:
[sage2@g1b-2 ~]$ /thinker/globe/soft/bibo/procone.py --tycano 10
Traceback (most recent call last):
File "/thinker/globe/soft/bibo/procone.py", line 189, in <module>
main()
File "/thinker/globe/soft/bibo/procone.py", line 85, in main
if reqtype == "delete":
UnboundLocalError: local variable 'reqtype' referenced before assignment
[sage2@g1b-2 ~]$
you need make sure all vars are assigned a value before they are used. I added
at the beginning of the code.
Now the query request works in tmux session ncat.
Code:
[zhihao@limbo30-1 processed]$ ( cat chendengchang-with-blank-line.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
...
],
"caseid": "67be23909e6311eabceb005056c00001",
"caseyear": 2016,
"casetitle": "马世龙(抢劫)核准追诉案",
"casetype": "最高人民检察院指导性案例",
"caserate": "5.00",
"caseaction": "抢劫罪",
"score": 100
}
]
}
delete seems to work as well.
Code:
[zhihao@limbo30-1 processed]$ ( cat del_zengxingliang.json; sleep 18 ) | ncat trajan.d-thinker.org 20050
{
"code": 200,
"msg": "ok",
"children": []
}
I am leaving tmux session ncat. You can proceed to test it and make sure delete works. Then inform the customer to test.