diff options
author | Jeix <devnull@localhost> | 2010-12-12 21:29:39 +0100 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-12-12 21:29:39 +0100 |
commit | f0e3226d5177fca52c15d12f37a66459150c28ab (patch) | |
tree | 81892db22ecc4b1167b247d0d0ead19eee1209e5 /module/plugins/hooks | |
parent | missing files... (diff) | |
download | pyload-f0e3226d5177fca52c15d12f37a66459150c28ab.tar.xz |
Chat interfaces (xmpp/irc): push/pull feature
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r-- | module/plugins/hooks/IRCInterface.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/module/plugins/hooks/IRCInterface.py b/module/plugins/hooks/IRCInterface.py index dc868ede9..b65a2e284 100644 --- a/module/plugins/hooks/IRCInterface.py +++ b/module/plugins/hooks/IRCInterface.py @@ -340,6 +340,28 @@ class IRCInterface(Thread, Hook): else: return ["ERROR: Use del command like this: del <-p|-l> <id> [...] (-p indicates that the ids are from packages, -l indicates that the ids are from links)"] + def event_push(self, args): + if not args: + return ["ERROR: Push package to queue like this: push <package id>"] + + id = int(args[0]) + if not self.sm.get_package_data(id): + return ["ERROR: Package #%d does not exist." % id] + + self.sm.push_package_to_queue(id) + return ["INFO: Pushed package %d to queue." % id] + + def event_pull(self, args): + if not args: + return ["ERROR: Pull package from queue like this: pull <package id>"] + + id = int(args[0]) + if not self.sm.get_package_data(id): + return ["ERROR: Package #%d does not exist." % id] + + self.sm.pull_out_package(id) + return ["INFO: Pulled package %d from queue to collector." % id] + def event_help(self, args): lines = [] lines.append("The following commands are available:") @@ -352,6 +374,8 @@ class IRCInterface(Thread, Hook): lines.append("more Shows more info when the result was truncated") lines.append("start Starts all downloads") lines.append("stop Stops the download (but not abort active downloads)") + lines.append("push <id> Push package to queue") + lines.append("pull <id> Pull package from queue") lines.append("status Show general download status") lines.append("help Shows this help message") return lines |