Added seconds args in import_dir

pull/151/head
Sami Mokaddem 2017-11-15 16:03:42 +01:00
parent 5bafc1fccc
commit ec7d2d49b2
1 changed files with 2 additions and 1 deletions

View File

@ -53,6 +53,7 @@ if __name__ == "__main__":
parser.add_argument('-p', '--port', type=int, default=5556, help='Zero MQ port') parser.add_argument('-p', '--port', type=int, default=5556, help='Zero MQ port')
parser.add_argument('-c', '--channel', type=str, default='102', help='Zero MQ channel') parser.add_argument('-c', '--channel', type=str, default='102', help='Zero MQ channel')
parser.add_argument('-n', '--name', type=str, default='import_dir', help='Name of the feeder') parser.add_argument('-n', '--name', type=str, default='import_dir', help='Name of the feeder')
parser.add_argument('-s', '--seconds', type=float, default=0.2, help='Second between pastes')
parser.add_argument('--hierarchy', type=int, default=1, help='Number of parent directory forming the name') parser.add_argument('--hierarchy', type=int, default=1, help='Number of parent directory forming the name')
args = parser.parse_args() args = parser.parse_args()
@ -90,4 +91,4 @@ if __name__ == "__main__":
print(args.name+'>'+wanted_path) print(args.name+'>'+wanted_path)
path_to_send = args.name + '>' + wanted_path path_to_send = args.name + '>' + wanted_path
socket.send('{} {} {}'.format(args.channel, path_to_send, base64.b64encode(messagedata))) socket.send('{} {} {}'.format(args.channel, path_to_send, base64.b64encode(messagedata)))
time.sleep(.2) time.sleep(args.seconds)