From 9558aafe67f9a115770d8683e89b3ca2e79493cf Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Mon, 17 Jul 2017 16:14:27 +0200 Subject: [PATCH 1/2] Prevent the loss of the 1 message in import_dir.py --- bin/import_dir.py | 3 ++- var/www/templates/header.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/import_dir.py b/bin/import_dir.py index 4cf308eb..331573d2 100755 --- a/bin/import_dir.py +++ b/bin/import_dir.py @@ -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) diff --git a/var/www/templates/header.html b/var/www/templates/header.html index c4232f92..06115400 100644 --- a/var/www/templates/header.html +++ b/var/www/templates/header.html @@ -25,7 +25,7 @@ -
  • myNewModule page
  • +
  • thisisatest
  • From f1a1e75c32f81127576249be55ed1a13e3fa9a9f Mon Sep 17 00:00:00 2001 From: Mokaddem Date: Mon, 17 Jul 2017 16:18:21 +0200 Subject: [PATCH 2/2] Restaured old example webpage --- var/www/templates/header.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/var/www/templates/header.html b/var/www/templates/header.html index 06115400..34682d07 100644 --- a/var/www/templates/header.html +++ b/var/www/templates/header.html @@ -25,7 +25,7 @@ -
  • thisisatest
  • +
  • myNewModule