From 277d138a5d2aa1aad8c15343ee813c09804a0907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Thu, 21 Aug 2014 14:39:17 +0200 Subject: [PATCH] cleanup, add FIXME --- bin/ZMQ_PubSub_Lines.py | 3 ++- bin/ZMQ_Sub_Attributes.py | 19 ++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/bin/ZMQ_PubSub_Lines.py b/bin/ZMQ_PubSub_Lines.py index 86104546..8d2d8cf3 100755 --- a/bin/ZMQ_PubSub_Lines.py +++ b/bin/ZMQ_PubSub_Lines.py @@ -84,11 +84,12 @@ if __name__ == "__main__": time.sleep(10) continue + # FIXME do it in the paste class lines_infos = PST.get_lines_info() - PST.save_attribute_redis("p_nb_lines", lines_infos[0]) PST.save_attribute_redis("p_max_length_line", lines_infos[1]) + # FIXME Not used. PST.store.sadd("Pastes_Objects", PST.p_path) if lines_infos[1] >= args.max: h.pub_channel = channel_0 diff --git a/bin/ZMQ_Sub_Attributes.py b/bin/ZMQ_Sub_Attributes.py index e88c3239..9b48b2be 100755 --- a/bin/ZMQ_Sub_Attributes.py +++ b/bin/ZMQ_Sub_Attributes.py @@ -62,17 +62,14 @@ if __name__ == "__main__": time.sleep(10) continue - encoding = PST._get_p_encoding() - language = PST._get_p_language() - - PST.save_attribute_redis("p_encoding", encoding) - PST.save_attribute_redis("p_language", language) - - PST.store.sadd("Pastes_Objects", PST.p_path) - + # FIXME do it directly in the class + PST.save_attribute_redis("p_encoding", PST._get_p_encoding()) + PST.save_attribute_redis("p_language", PST._get_p_language()) + # FIXME why not all saving everything there. PST.save_all_attributes_redis() + # FIXME Not used. + PST.store.sadd("Pastes_Objects", PST.p_path) except IOError: print "CRC Checksum Failed on :", PST.p_path - publisher.error('{0};{1};{2};{3};{4}'.format( - "Duplicate", PST.p_source, PST.p_date, PST.p_name, - "CRC Checksum Failed")) + publisher.error('Duplicate;{};{};{};CRC Checksum Failed'.format( + PST.p_source, PST.p_date, PST.p_name))