~vorlon/ubuntu/saucy/gourmet/trunk

« back to all changes in this revision

Viewing changes to src/lib/plugins/key_editor/keyEditor.py

  • Committer: Bazaar Package Importer
  • Author(s): Rolf Leggewie
  • Date: 2009-02-10 17:34:51 UTC
  • mfrom: (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090210173451-bt0a6j0ut71oxqes
Tags: 0.14.5-1
* new upstream release
* 0.14.5 no longer conflicts with newer versions of python-pysqlite and
  python-sqlalchemy.  Relax dependencies accordingly.
* all patches have been pushed upstream, so they can be dropped in Debian.
  The manpage was forgotten when preparing the tarball upstream, so it
  will stick around for another release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
            'applyEntries':self.applyEntriesCB,
72
72
            'clearEntries':self.clearEntriesCB,
73
73
            'close_window': lambda *args: self.window.hide(),
74
 
            'editNutritionalInfo':self.editNutritionalInfoCB,
 
74
            #'editNutritionalInfo':self.editNutritionalInfoCB,
75
75
            })
76
76
        # setup mnemonic manager
77
77
        self.mm = mnemonic_manager.MnemonicManager()
109
109
                       [self.VALUE_COL,_('Value')],
110
110
                       [self.COUNT_COL,_('Count')],
111
111
                       [self.REC_COL, _('Recipes')],
112
 
                       [self.NUT_COL, _('Nutritional Info')],
 
112
                       #[self.NUT_COL, _('Nutritional Info')],
113
113
                       ]:
114
114
            if n == self.NUT_COL:
115
115
                renderer = gtk.CellRendererToggle()
372
372
            curdic,field = self.get_dic_describing_iter(itr)
373
373
            curkey = self.treeModel.get_value(itr,self.VALUE_COL)
374
374
            if not already_updated:
375
 
                self.rd.update(
 
375
                self.rd.update_by_criteria(
376
376
                    self.rd.ingredients_table,
377
377
                    curdic,
378
378
                    newdic,
506
506
    UNIT = _('Unit')+':'
507
507
    AMOUNT = _('Amount')+':'    
508
508
    
509
 
    columns = ['obj','ingkey','item','count','recipe','ndbno']
 
509
    columns = ['obj','ingkey','item','count','recipe']#,'ndbno']
510
510
    def __init__ (self, rd, per_page=15):
511
511
        self.rd = rd
512
512
        pageable_store.PageableTreeStore.__init__(self,
515
515
                                                   str, # value
516
516
                                                   int, # count
517
517
                                                   str, # recipe
518
 
                                                   int, # nutritional information equivalent
 
518
                                                   #int, # nutritional information equivalent
519
519
                                                   ],
520
520
                                                  per_page=per_page)
521
521
 
577
577
                # avoidable slowdown (look here if code seems sluggish)
578
578
                row.count,
579
579
                None,
580
 
                row.ndbno or 0,
 
580
                #row.ndbno or 0,
581
581
                ]
582
582
 
583
583
    def _get_children_ (self,itr):
592
592
                            item,
593
593
                            self.rd.fetch_len(self.rd.ingredients_table,ingkey=ingkey,item=item),
594
594
                            self.get_recs(ingkey,item),
595
 
                            0
 
595
                            #0
596
596
                            ])
597
597
        elif field==self.ITEM:
598
598
            ingkey = self.get_value(self.iter_parent(itr),2)
603
603
                            unit,
604
604
                            self.rd.fetch_len(self.rd.ingredients_table,ingkey=ingkey,item=item,unit=unit),
605
605
                            None,
606
 
                            0])
 
606
                            ])
607
607
            if not ret:
608
608
                ret.append([None,
609
609
                            self.UNIT,
610
610
                            '',
611
611
                            self.get_value(self.iter_parent(itr),3),
612
612
                            None,
613
 
                            0])                
 
613
                            ])                
614
614
        elif field==self.UNIT:
615
615
            item = self.get_value(self.iter_parent(itr),2)
616
616
            ingkey = self.get_value(self.iter_parent(
633
633
                                                   unit=unit,
634
634
                                                   amount=i.amount)),
635
635
                            None,
636
 
                            0])
 
636
                            ])
637
637
                amounts.append(astring)
638
638
            if not ret:
639
639
                ret.append([None,
641
641
                            '',
642
642
                            self.get_value(self.iter_parent(itr),3),
643
643
                            None,
644
 
                            0])
 
644
                            ])
645
645
            
646
646
        return ret
647
647
        #row = row[0]