#!/usr/bin/env python3
# coding: utf-8

import rpyc
from argparse import ArgumentParser

if __name__ == '__main__':
	parser = ArgumentParser()
	parser.add_argument('file_name', type=str)
	args = vars(parser.parse_args())

	file_name = args['file_name']

	if file_name.split('.')[-1] != 'json':
		print('json file required.')
		exit(1)
	try:
		con = rpyc.connect('localhost', port=1234)
		con._config['sync_request_timeout'] = None
	except Exception as e:
		print('Unable to connect to rpyc server.')
		exit(1)
	con.root.set_paused(file_name)
	print('run paused.')
