forked from binary-husky/vhmap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththreejs_replay.py
28 lines (23 loc) · 947 Bytes
/
threejs_replay.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import os, sys
import argparse
from vhmap.mcom import *
from vhmap.mcom_replay import RecallProcessThreejs
from vhmap.utils.network import find_free_port
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='HMP')
parser.add_argument('-f', '--file', help='Directory of chosen file', default='TEMP/v3d_logger/backup.dp.gz')
parser.add_argument('-p', '--port', help='The port for web server')
args, unknown = parser.parse_known_args()
if hasattr(args, 'file'):
path = args.file
else:
assert False, (r"parser.add_argument('-f', '--file', help='The node name is?')")
if hasattr(args, 'port') and args.port is not None:
port = int(args.port)
else:
port = find_free_port()
print('no --port arg, auto find:', port)
load_via_json = (hasattr(args, 'cfg') and args.cfg is not None)
rp = RecallProcessThreejs(path, port)
rp.start()
rp.join()