mirror of
https://github.com/Tygs/0bin.git
synced 2023-08-10 21:13:00 +03:00
Add compatibility with python 2
This commit is contained in:
parent
7aa7873b48
commit
bd7a372551
@ -1,4 +1,8 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
# coding: utf-8
|
||||||
|
|
||||||
from zerobin.paste import Paste
|
from zerobin.paste import Paste
|
||||||
|
from sigtools.modifiers import annotate, autokwoargs
|
||||||
from clize import run
|
from clize import run
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -16,17 +20,18 @@ def unpack_paste(paste):
|
|||||||
return try_url.group('paste_id')
|
return try_url.group('paste_id')
|
||||||
return paste
|
return paste
|
||||||
|
|
||||||
|
@annotate(quiet='q')
|
||||||
def remove_paste(*pastes, quiet:'q'=False):
|
@autokwoargs
|
||||||
|
def remove_paste(quiet=False, *pastes):
|
||||||
"""
|
"""
|
||||||
Remove pastes, given its ID or its URL
|
Remove pastes, given its ID or its URL
|
||||||
|
|
||||||
pastes: List of pastes, given by ID or URL
|
|
||||||
|
|
||||||
quiet: Don't print anything
|
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:
|
try:
|
||||||
Paste.load(paste_uuid).delete()
|
Paste.load(paste_uuid).delete()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user