[bug-gnutrition] Error report (app freezes when adding multiple ingredients to recipe) and patch proposal
jrbruce@vt.edu
jrbruce86@gmail.com
Thu May 30 02:34:57 BST 2013
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, jrbruce@vt.edu <jrbruce86@gmail.com> 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, jrbruce@vt.edu <jrbruce86@gmail.com> 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 <jself@gnu.org> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch5.diff
Type: application/octet-stream
Size: 741 bytes
Desc: not available
URL: <http://www.ocelot.cascaded.net/pipermail/gnutrition/attachments/20130529/bb21d360/attachment.bin>
More information about the GNUtrition
mailing list