Пример #1
0
 def __init__(self):
     threading.Thread.__init__(self)
     self.setDaemon(True)
     self.active = True
     self.title = self.__class__.__name__
     self.navbar = widget.get("NavigationBar")
     self.status = ""
Пример #2
0
 def __init__(self):
     def _input(key):
         if widgets.cmdline.active:
             widgets.cmdline.input(key)
         elif widgets.menu.active:
             widgets.menu.input(key)
         elif widgets.help.active:
             widgets.help.input(key)
         else:
             widgets.filer.input(key)
     def _draw():
         widgets.filer.draw(navigation=False)
         if widgets.menu.active:
             widgets.menu.draw()
         if widgets.cmdline.active:
             widgets.cmdline.draw()
         elif widgets.help.active:
             widgets.helper.draw()
         else:
             if widgets.message.active and not widgets.filer.finder.active:
                 widgets.message.draw()
             self.draw_thread()
     self.navbar = widget.get("NavigationBar")
     self.ui = widget.ui.UI(_draw, _input)
     self.stdscr = widget.base.StandardScreen.stdscr
Пример #3
0
 def copyfileobj(self, fsrc, fdst, length=16*1024):
     curval = 0
     navbar = widget.get("NavigationBar")
     size = os.stat(self.src).st_size
     if size:
         gauge = ProgressGauge(size)
     else:
         gauge = ProgressGauge(1)
     while True:
         buf = fsrc.read(length)
         if not buf:
             gauge.finish()
             if not widgets.cmdline.active:
                 navbar.draw(gauge.draw, 1, 1)
             break
         curval += len(buf)
         gauge.update(curval)
         if not widgets.cmdline.active:
             navbar.draw(gauge.draw, 1, 1)
         fdst.write(buf)
Пример #4
0
 def action(self):
     return widget.get("ActionBox")
Пример #5
0
 def help(self):
     return widget.get("Help")
Пример #6
0
 def message(self):
     return widget.get("Message")
Пример #7
0
 def menu(self):
     return widget.get("Menu")
Пример #8
0
 def cmdline(self):
     return widget.get("Cmdline")
Пример #9
0
 def filer(self):
     return widget.get("Filer")