From bd7a37255176992e1d78c018e27d6aa99e5beec6 Mon Sep 17 00:00:00 2001 From: Shir0kamii Date: Thu, 17 Sep 2015 02:51:31 +0200 Subject: [PATCH] Add compatibility with python 2 --- zerobin/remove_paste.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/zerobin/remove_paste.py b/zerobin/remove_paste.py index 8f60b21..9b6ebc4 100644 --- a/zerobin/remove_paste.py +++ b/zerobin/remove_paste.py @@ -1,4 +1,8 @@ +#!/usr/bin/env python +# coding: utf-8 + from zerobin.paste import Paste +from sigtools.modifiers import annotate, autokwoargs from clize import run import re @@ -16,17 +20,18 @@ def unpack_paste(paste): return try_url.group('paste_id') return paste - -def remove_paste(*pastes, quiet:'q'=False): +@annotate(quiet='q') +@autokwoargs +def remove_paste(quiet=False, *pastes): """ Remove pastes, given its ID or its URL - pastes: List of pastes, given by ID or URL - quiet: Don't print anything + + pastes: List of pastes, given by ID or URL """ - for paste_uuid in map(unpack_paste, paste_list): + for paste_uuid in map(unpack_paste, pastes): try: Paste.load(paste_uuid).delete()