Просмотр исходного кода

Update 3-tier.py

Now, it can print the product list correctly.
lord63 10 лет назад
Родитель
Сommit
c7f8f13454
1 измененных файлов с 7 добавлено и 2 удалено
  1. 7 2
      3-tier.py

+ 7 - 2
3-tier.py

@@ -38,8 +38,7 @@ class Ui(object):
     def get_product_list(self):
     def get_product_list(self):
         print('PRODUCT LIST:')
         print('PRODUCT LIST:')
         for product in self.business_logic.product_list():
         for product in self.business_logic.product_list():
-            #print(product)
-            yield product
+            print(product)
         print('')
         print('')
 
 
     def get_product_information(self, product):
     def get_product_information(self, product):
@@ -66,6 +65,12 @@ if __name__ == '__main__':
     main()
     main()
 
 
 ### OUTPUT ###
 ### OUTPUT ###
+# PRODUCT LIST:
+# (Fetching from Data Store)
+# cheese
+# eggs
+# milk
+# 
 # (Fetching from Data Store)
 # (Fetching from Data Store)
 # PRODUCT INFORMATION:
 # PRODUCT INFORMATION:
 # Name: Cheese, Price: 2.00, Quantity: 10
 # Name: Cheese, Price: 2.00, Quantity: 10