Merge pull request #129 from mokaddem/master

Avoid loosing the first message in import_dir.py
pull/132/head
mokaddem 2017-07-17 16:19:23 +02:00 committed by GitHub
commit ad853b8bd8
2 changed files with 3 additions and 2 deletions

View File

@ -18,10 +18,11 @@ if __name__ == "__main__":
context = zmq.Context()
socket = context.socket(zmq.PUB)
socket.bind("tcp://*:{}".format(args.port))
time.sleep(1) #Important, avoid loosing the 1 message
for dirname, dirnames, filenames in os.walk(args.directory):
for filename in filenames:
messagedata = open(os.path.join(dirname, filename)).read()
print(os.path.join(dirname, filename))
socket.send('{} {} {}'.format(args.channel, filename, base64.b64encode(messagedata)))
time.sleep(.1)
time.sleep(.2)

View File

@ -25,7 +25,7 @@
</ul>
</li>
<li id='page-myNewModule'><a href="{{ url_for('myNewModule.myNewModule_page') }}"><i class="glyphicon glyphicon-new-window"></i> myNewModule page</a></li>
<li id='page-myNewModule'><a href="{{ url_for('myNewModule.myNewModule_page') }}"><i class="glyphicon glyphicon-new-window"></i> myNewModule </a></li>
</ul>
</div>