def __init__(self, client, command): self.client = client self.command = command if not self.command: renameProcess('pyload-cli') self.getch = Getch() self.input = "" self.inputline = 0 self.lastLowestLine = 0 self.menuline = 0 self.lock = Lock() #processor funcions, these will be changed dynamically depending on control flow self.headerHandler = self #the download status self.bodyHandler = self #the menu section self.inputHandler = self os.system("clear") println( 1, blue("py") + yellow("Load") + white(_(" Command Line Interface"))) println(2, "") self.thread = RefreshThread(self) self.thread.start() self.start() else: self.processCommand()
def __init__(self, client, command): self.client = client self.command = command if not self.command: renameProcess('pyLoadCli') self.getch = Getch() self.input = "" self.inputline = 0 self.lastLowestLine = 0 self.menuline = 0 self.lock = Lock() #processor funcions, these will be changed dynamically depending on control flow self.headerHandler = self #the download status self.bodyHandler = self #the menu section self.inputHandler = self os.system("clear") println(1, blue("py") + yellow("Load") + white(_(" Command Line Interface"))) println(2, "") self.thread = RefreshThread(self) self.thread.start() self.start() else: self.processCommand()
class Notification(QObject): def __init__(self, tray): QObject.__init__(self) self.tray = tray self.usePynotify = False try: self.usePynotify = pynotify.init("icon-summary-body") except: print("init error") def showMessage(self, body): if self.usePynotify: n = pynotify.Notification("pyload", body, join(pypath, "icons", "logo.png")) try: n.set_hint_string("x-canonical-append", "") except: pass n.show() else: self.tray.showMessage("pyload", body) if __name__ == "__main__": renameProcess('pyLoadGui') app = main() app.loop()
if reason == QSystemTrayIcon.Trigger: self.showAction.toggle() class Notification(QObject): def __init__(self, tray): QObject.__init__(self) self.tray = tray self.usePynotify = False try: self.usePynotify = pynotify.init("icon-summary-body") except: print "init error" def showMessage(self, body): if self.usePynotify: n = pynotify.Notification("pyload", body, join(pypath, "icons", "logo.png")) try: n.set_hint_string("x-canonical-append", "") except: pass n.show() else: self.tray.showMessage("pyload", body) if __name__ == "__main__": renameProcess('pyLoadGui') app = main() app.loop()