diff options
-rw-r--r-- | distixlib/plugins/reply_plugin.py | 43 | ||||
-rw-r--r-- | without-tests | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/distixlib/plugins/reply_plugin.py b/distixlib/plugins/reply_plugin.py new file mode 100644 index 0000000..5c9a724 --- /dev/null +++ b/distixlib/plugins/reply_plugin.py @@ -0,0 +1,43 @@ +# Copyright 2014 Lars Wirzenius +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. +# +# =*= License: GPL-3+ =*= + + +import os + +import cliapp + +import distixlib + + +class ReplyPlugin(cliapp.Plugin): + + def enable(self): + self.app.add_subcommand( + 'reply', self.reply, arg_synopsis='TICKETID') + + self.app.settings.string( + ['message', 'm'], + 'use MSG as the message body of the reply', + metavar='MSG') + + def disable(self): + pass + + def reply(self, args): + '''Add a reply message to a ticket.''' + + self.app.settings.require('message') diff --git a/without-tests b/without-tests index ba6ab5d..a96ce4d 100644 --- a/without-tests +++ b/without-tests @@ -5,5 +5,6 @@ distixlib/plugins/init_plugin.py distixlib/plugins/list_plugin.py distixlib/plugins/metadata_manipulation_plugin.py distixlib/plugins/new_plugin.py +distixlib/plugins/reply_plugin.py distixlib/plugins/set_plugin.py distixlib/plugins/show_plugin.py |