Ticket #3288: 0001-Fix-example.patch

File 0001-Fix-example.patch, 888 bytes (added by davep, 6 years ago)
  • doc/core/examples/ampserver.py

    From c294d9c94944fe409e8e6bc64d54dba269a226d3 Mon Sep 17 00:00:00 2001
    From: Dave Peticolas <dave@krondo.com>
    Date: Sat, 7 Jun 2008 17:49:25 -0700
    Subject: [PATCH] Fix example.
    
    ---
     doc/core/examples/ampserver.py |    4 ++--
     1 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/doc/core/examples/ampserver.py b/doc/core/examples/ampserver.py
    index 393cfec..7b5adf0 100644
    a b class Math(amp.AMP): 
    2121    Sum.responder(sum) 
    2222 
    2323    def divide(self, numerator, denominator): 
    24         result = numerator / denominator 
    25         print 'Divided: %d / %d = %d' % (numerator, denominator, total) 
     24        result = float(numerator) / denominator 
     25        print 'Divided: %d / %d = %f' % (numerator, denominator, result) 
    2626        return {'result': result} 
    2727    Divide.responder(divide) 
    2828