woob.capabilities.paste
¶
- class BasePaste(_id, title=NotLoaded, language=NotLoaded, contents=NotLoaded, public=NotLoaded, url=None)[source]¶
Bases:
BaseObject
Represents a pasted text.
- Variables:
- property page_url¶
Get URL to page of this paste.
- class CapPaste[source]¶
Bases:
Capability
This capability represents the ability for a website backend to store plain text.
- new_paste(*args, **kwargs)[source]¶
Get a new paste object for posting it with the backend. The parameters should be passed to the object init.
- Return type:
- can_post(contents, title=None, public=None, max_age=None)[source]¶
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).
contents: Can be used to check encodability, maximum length, etc. title: Can be used to check length, allowed characters. Should not be required. public: True must be public, False must be private, None do not care. max_age: Maximum time to live in seconds.
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 type:
- Returns:
score