Don't crash if InfoScrap doesn't exist (as is the case in Carbon).

This commit is contained in:
Jack Jansen 2001-04-25 22:05:36 +00:00
parent 9188b2194a
commit ee677913df
1 changed files with 5 additions and 2 deletions

View File

@ -155,7 +155,6 @@ class TEWindow(ScrolledWindow):
self.parent.updatemenubar() self.parent.updatemenubar()
def menu_paste(self): def menu_paste(self):
print 'SCRAP', Scrap.InfoScrap(), `Scrap.InfoScrap()[1].data`
TE.TEFromScrap() TE.TEFromScrap()
self.ted.TESelView() self.ted.TESelView()
self.ted.TEPaste() self.ted.TEPaste()
@ -224,7 +223,11 @@ class Ped(Application):
m.enable(on) m.enable(on)
self.focusgroup_on = on self.focusgroup_on = on
changed = 1 changed = 1
on = (Scrap.InfoScrap()[0] <> 0) if hasattr(Scrap, 'InfoScrap'):
on = (Scrap.InfoScrap()[0] <> 0)
else:
# Not there yet on Carbon, simply always enable
on = 1
if on <> self.pastegroup_on: if on <> self.pastegroup_on:
self.pasteitem.enable(on) self.pasteitem.enable(on)
self.pastegroup_on = on self.pastegroup_on = on