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 = ""
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
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)
def action(self): return widget.get("ActionBox")
def help(self): return widget.get("Help")
def message(self): return widget.get("Message")
def menu(self): return widget.get("Menu")
def cmdline(self): return widget.get("Cmdline")
def filer(self): return widget.get("Filer")