Beispiel #1
0
 def gListbox(self, **kw):
     log("gListbox:called:", str(kw))
     ret = None
     try:
         self.save()
     except Exception, e:
         generate_error_report()
         log("gListbox:error saving")
Beispiel #2
0
 def gListbox(self,**kw):
  log("gListbox:called:",str(kw))
  ret=None
  try:
   self.save()
  except Exception,e:
   generate_error_report()
   log("gListbox:error saving")
Beispiel #3
0
 def gFileBrowser(self, **kw):
     kw['screen'] = self.screen
     kw['maxy'] = self.maxy
     kw['maxx'] = self.maxx
     ret = None
     try:
         self.save()
     except Exception, e:
         generate_error_report()
Beispiel #4
0
 def gFileBrowser(self,**kw):
  kw['screen']=self.screen
  kw['maxy']=self.maxy
  kw['maxx']=self.maxx
  ret=None
  try:
   self.save()
  except Exception,e:
   generate_error_report()
Beispiel #5
0
 def gCheckbox(self, **kw):
     kw['screen'] = self.screen
     kw['maxy'] = self.maxy
     kw['maxx'] = self.maxx
     self.save()
     ret = None
     try:
         c = Checkbox(**kw)
         ret = c.loop()
     except Exception, e:
         generate_error_report()
Beispiel #6
0
 def gCheckbox(self,**kw):
  kw['screen']=self.screen
  kw['maxy']=self.maxy
  kw['maxx']=self.maxx
  self.save()
  ret=None
  try:
   c=Checkbox(**kw)
   ret=c.loop()
  except Exception,e:
   generate_error_report()
Beispiel #7
0
 def gEditbox(self, **kw):
     kw['screen'] = self.screen
     ret = None
     try:
         self.save()
     except:
         generate_error_report()
     try:
         e = Editbox(**kw)
         ret = e.loop()
     except Exception, e:
         ret = generate_error_report()
Beispiel #8
0
 def gEditbox(self,**kw):
  kw['screen']=self.screen
  ret=None
  try:
   self.save()
  except:
   generate_error_report()
  try:
   e=Editbox(**kw)
   ret=e.loop()
  except Exception,e:
   ret=generate_error_report()
Beispiel #9
0
 def paintScreen(self, dirty=None):
     #  log("paintScreen")
     self.nidx = -1
     w = self.maxx
     self.y, self.x = 0, 0
     #  log("nodes from doc:"+str(self.dom.document))
     try:
         nodes = self.iterNodes(self.dom.document)
         self.parser = contentParser.htmlParser(nodes, self.maxx)
         self._display = self.parser.parse()
         self.numLines = max(self._display.keys())
     except Exception, e:
         utils.generate_error_report()
         self.setStatus(str(e))
Beispiel #10
0
 def paintScreen(self,dirty=None):
#  log("paintScreen")
  self.nidx=-1
  w=self.maxx
  self.y,self.x=0,0
#  log("nodes from doc:"+str(self.dom.document))
  try:
   nodes=self.iterNodes(self.dom.document)
   self.parser=contentParser.htmlParser(nodes,self.maxx)
   self._display=self.parser.parse()
   self.numLines=max(self._display.keys())
  except Exception,e:
   utils.generate_error_report()
   self.setStatus(str(e))
Beispiel #11
0
class forms(object):
    form_screens = []

    def save(self):
        pos = self.screen.getyx()
        log("save:pos", pos)
        screenFN = os.tempnam(None, "pywb.scrnfrm.")
        fh = open(screenFN, "wb")
        self.screen.putwin(fh)
        fh.close()
        self.form_screens.append((pos, screenFN))

    def restore(self):
        self.screen.clear()
        pos, fn = self.form_screens.pop(-1)
        fh = open(fn, "rb")
        self.screen = curses.getwin(fh)
        self.screen.move(pos[0], pos[1])
        log("restore:pos", pos)
        fh.close()
        os.remove(fn)

    def gFileBrowser(self, **kw):
        kw['screen'] = self.screen
        kw['maxy'] = self.maxy
        kw['maxx'] = self.maxx
        ret = None
        try:
            self.save()
        except Exception, e:
            generate_error_report()
        try:
            fb = FileBrowser(**kw)
            ret = fb.keyHandler()
        except Exception, e:
            generate_error_report()
Beispiel #12
0
        kw['maxy'] = self.maxy
        kw['maxx'] = self.maxx
        ret = None
        try:
            self.save()
        except Exception, e:
            generate_error_report()
        try:
            fb = FileBrowser(**kw)
            ret = fb.keyHandler()
        except Exception, e:
            generate_error_report()
        try:
            self.restore()
        except Exception, e:
            generate_error_report()
            log("gDirBrowser:error restoring window")
        return ret

    def gListbox(self, **kw):
        log("gListbox:called:", str(kw))
        ret = None
        try:
            self.save()
        except Exception, e:
            generate_error_report()
            log("gListbox:error saving")
        try:
            l = Listbox(**kw)
            while not l.done:
                c = self.screen.getch()
Beispiel #13
0
  kw['maxy']=self.maxy
  kw['maxx']=self.maxx
  ret=None
  try:
   self.save()
  except Exception,e:
   generate_error_report()
  try:
   fb=FileBrowser(**kw)
   ret=fb.keyHandler()
  except Exception, e:
   generate_error_report()
  try:
   self.restore()
  except Exception,e :
   generate_error_report()
   log("gDirBrowser:error restoring window")
  return ret

 def gListbox(self,**kw):
  log("gListbox:called:",str(kw))
  ret=None
  try:
   self.save()
  except Exception,e:
   generate_error_report()
   log("gListbox:error saving")
  try:
   l=Listbox(**kw)
   while not l.done:
    c=self.screen.getch()