Procházet zdrojové kódy

fix indentation and comment out deprecated library calls in epc

laxaurus před 8 roky
rodič
revize
85daa72e99
2 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 9 1
      comms/epc.py
  2. 2 2
      finopt/opt_serve.py

+ 9 - 1
comms/epc.py

@@ -27,7 +27,15 @@ class EPCPub():
         host = config.get("epc", "kafka.host").strip('"').strip("'")
         port = config.get("epc", "kafka.port")
 
-        client = KafkaClient('%s:%s' % (host, port))
+        
+        
+        #client = KafkaClient('%s:%s' % (host, port))
+        
+        # this version of kafka client has already deprecated 
+        # the program no longer works with the latest version of kafka
+        # the next line is just to make the program starts up
+        client = None
+        
         self.producer = SimpleProducer(client, async=False)
         
                 

+ 2 - 2
finopt/opt_serve.py

@@ -60,8 +60,8 @@ class QServer(object):
         stackpos_link = "<a href=./ws_position_chart_ex><img src='public/scale.png' width='42' height='42' />Positions (Stacked View)</a>"
         bubble_link = "<a href=./port_bubble_chart><img src='public/Market-Risk-Icon.png' width='42' height='42' />Risk Distributions</a>"
 
-    html = ''
-    s_line = ''
+        html = ''
+        s_line = ''
 
         return """<html><body><li>%s</li><li>%s</li><li>%s</li><li>%s</li><br><dl>%s</dl></br>%s</body></html>""" % (bubble_link, impl_link, pos_link, stackpos_link, html, s_line)