bug-gnutrition
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gnutrition] Error report (app freezes when adding multiple ingr


From: address@hidden
Subject: Re: [bug-gnutrition] Error report (app freezes when adding multiple ingredients to recipe) and patch proposal
Date: Wed, 29 May 2013 22:35:36 -0400

Here is another simple patch that addresses the same problem as patch5
but which occurs from the recipe window rather than the plan window.

diff -rc ./src/nutr_composition_dlg.py
../gnutrition-0.32-changed-just6/src/nutr_composition_dlg.py
*** ./src/nutr_composition_dlg.py    2012-09-01 12:43:08.000000000 -0400
--- ../gnutrition-0.32-changed-just6/src/nutr_composition_dlg.py
2013-05-29 22:24:27.071431972 -0400
***************
*** 93,102 ****
              "WHERE NDB_No ='%d'" % (food_num))
          list_food_nutr = self.db.get_result()

!         self.db.query("SELECT Gm_wgt FROM weight " +
!             "WHERE NDB_No ='{0:d}' AND Msre_Desc ='{1:s}'".format(
                      food_num, msre_desc))
!         gm_per_msre = self.db.get_single_result()

          for i in range(len(self.list_nutr_tot)):
              tot_nutr_num, tot_nutr_val = self.list_nutr_tot[i]
--- 93,105 ----
              "WHERE NDB_No ='%d'" % (food_num))
          list_food_nutr = self.db.get_result()

!
!         gm_per_msre = 1
!         if msre_desc != "gm"  :
!             self.db.query("SELECT Gm_wgt FROM weight " +
!                           "WHERE NDB_No ='{0:d}' AND Msre_Desc
='{1:s}'".format(
                      food_num, msre_desc))
!             gm_per_msre = self.db.get_single_result()

          for i in range(len(self.list_nutr_tot)):
              tot_nutr_num, tot_nutr_val = self.list_nutr_tot[i]

On Wed, May 29, 2013 at 9:34 PM, address@hidden <address@hidden> wrote:
> Here is another patch I made since the app was freezing whenever I
> tried to add a measurement already in grams to a plan's total. Just
> setting the gm_per_measure to 1 when the measurement is already in
> grams prevented the app from freezing.
>
> diff -rc ./src/plan_compute_dlg.py
> ../gnutrition-0.32-changed/src/plan_compute_dlg.py
> *** ./src/plan_compute_dlg.py    2012-09-01 12:43:08.000000000 -0400
> --- ../gnutrition-0.32-changed/src/plan_compute_dlg.py    2013-05-29
> 21:14:00.772001848 -0400
> ***************
> *** 124,129 ****
> --- 124,131 ----
>           return self.db.get_result()
>   #HERE: take into account Amount unit modifier
>       def get_gm_per_measure(self, food_num, msre_desc):
> +         if msre_desc == "gm" :
> +             return 1
>           self.db.query("SELECT Gm_wgt FROM weight WHERE " +
>               "NDB_No = '%d' AND Msre_Desc = '%s'" %(food_num, msre_desc))
>           return float(self.db.get_single_result())
> Only in ../gnutrition-0.32-changed/src: plan_compute_dlg.py~
>
>
>
> On Wed, May 29, 2013 at 12:46 AM, address@hidden <address@hidden> wrote:
>> Here are all 4 of my patches separated out and a README file which
>> describes each of them. I also included a single patch which applies
>> all 4 of them at once.
>>
>> - Jake
>>
>> On Thu, May 23, 2013 at 6:44 PM, address@hidden <address@hidden> wrote:
>>> Sure I can send in the separate patches tonight or tomorrow, time
>>> permitting. I'll make sure the keep them separate in the future.
>>>
>>> I'm totally willing to assign any and all copyrights to FSF. Just glad
>>> to see any changes I propose to help improve the app.
>>>
>>>
>>>
>>> On Thu, May 23, 2013 at 6:29 PM, Jason Self <address@hidden> wrote:
>>>>> Here is the patch (it is also attached to the email). If you wnat just
>>>>> the patch for the two errors let me know (this is a patch for all the
>>>>> bug fixes I've made on my computer so far):
>>>>
>>>> In general separating logical changes into separate patches is best.
>>>>
>>>> Also, would you be willing to assign the copyright for your work on
>>>> GNUtrition to the Free Software Foundation?
>>>>
>>>> _______________________________________________
>>>> https://lists.gnu.org/mailman/listinfo/bug-gnutrition

Attachment: patch6.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]