예제 #1
0
파일: browser.py 프로젝트: Bercio/gourmet
 def append_button (self, path):
     if '>' in path:
         txt = self.view.convert_val(*path.split('>'))
     else:
         txt = path
     self.buttons.append(gtk.Button(REC_ATTR_DIC.get(txt,txt)))
     self.buttons[-1].connect('clicked',lambda *args: self.view.set_path(path))
     self.button_bar.pack_start(self.buttons[-1],expand=False,fill=False)
     self.buttons[-1].show()
예제 #2
0
파일: browser.py 프로젝트: tmccombs/gourmet
 def append_button(self, path):
     if '>' in path:
         txt = self.view.convert_val(*path.split('>'))
     else:
         txt = path
     self.buttons.append(gtk.Button(REC_ATTR_DIC.get(txt, txt)))
     self.buttons[-1].connect('clicked',
                              lambda *args: self.view.set_path(path))
     self.button_bar.pack_start(self.buttons[-1], expand=False, fill=False)
     self.buttons[-1].show()
예제 #3
0
파일: browser.py 프로젝트: wummel/gourmet
 def append_button(self, path):
     if '>' in path:
         attribute, value = path.split('>')
         value = int(value)
         txt = self.view.convert_val(attribute, value)
     else:
         txt = path
     self.buttons.append(Gtk.Button(REC_ATTR_DIC.get(txt, txt)))
     self.buttons[-1].connect('clicked',
                              lambda *args: self.view.set_path(path))
     self.button_bar.pack_start(self.buttons[-1], False, False, 0)
     self.buttons[-1].show()
예제 #4
0
파일: exporter.py 프로젝트: maweki/gourmet
 def _write_attrs_ (self):
     self.write_attr_head()
     for a in self.attr_order:
         txt=self._grab_attr_(self.r,a)
         debug('_write_attrs_ writing %s=%s'%(a,txt),1)
         if txt and ((not isinstance(txt, str)) or txt.strip()):
             if (a=='preptime' or a=='cooktime') and a.find("0 ")==0: pass
             else:
                 if self.convert_attnames:
                     self.write_attr(REC_ATTR_DIC.get(a,a),txt)
                 else:
                     self.write_attr(a,txt)
     self.write_attr_foot()
예제 #5
0
 def _write_attrs_(self):
     self.write_attr_head()
     for a in self.attr_order:
         txt = self._grab_attr_(self.r, a)
         debug("_write_attrs_ writing %s=%s" % (a, txt), 1)
         if txt and ((type(txt) not in [str, unicode]) or txt.strip()):
             if (a == "preptime" or a == "cooktime") and a.find("0 ") == 0:
                 pass
             else:
                 if self.convert_attnames:
                     self.write_attr(REC_ATTR_DIC.get(a, a), txt)
                 else:
                     self.write_attr(a, txt)
     self.write_attr_foot()