CapPaste: add method to find if a paste is suitable for the backend
Basic support in pastoob added (there is no way yet to change the default options). Backends support the "public/private" requirement.
This commit is contained in:
parent
9022435e49
commit
fbd4511ffa
6 changed files with 50 additions and 3 deletions
|
|
@ -64,6 +64,22 @@ class ICapPaste(IBaseCap):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def can_post(self, public=None):
|
||||
"""
|
||||
Checks if the paste can be pasted by this backend.
|
||||
Some properties are considered required (public/private, max_age) while others
|
||||
are just bonuses (language).
|
||||
|
||||
public: True must be public, False must be private, None do not care
|
||||
|
||||
A score of 0 means the backend is not suitable.
|
||||
A score of 1 means the backend is suitable.
|
||||
Higher scores means it is more suitable than others with a lower score.
|
||||
|
||||
@return int Score
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def get_paste(self, url):
|
||||
"""
|
||||
Get a Paste from an ID or URL.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue