repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_documentation_string stringlengths 1 47.2k | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|
user-cont/colin | colin/core/target.py | OstreeTarget._checkout | def _checkout(self):
""" check out the image filesystem on self.mount_point """
cmd = ["atomic", "mount", "--storage", "ostree", self.ref_image_name, self.mount_point]
# self.mount_point has to be created by us
self._run_and_log(cmd, self.ostree_path,
"Failed to... | python | def _checkout(self):
""" check out the image filesystem on self.mount_point """
cmd = ["atomic", "mount", "--storage", "ostree", self.ref_image_name, self.mount_point]
# self.mount_point has to be created by us
self._run_and_log(cmd, self.ostree_path,
"Failed to... | check out the image filesystem on self.mount_point | https://github.com/user-cont/colin/blob/00bb80e6e91522e15361935f813e8cf13d7e76dc/colin/core/target.py#L394-L399 |
user-cont/colin | colin/core/target.py | OstreeTarget._run_and_log | def _run_and_log(cmd, ostree_repo_path, error_msg, wd=None):
""" run provided command and log all of its output; set path to ostree repo """
logger.debug("running command %s", cmd)
kwargs = {
"stderr": subprocess.STDOUT,
"env": os.environ.copy(),
}
if ostr... | python | def _run_and_log(cmd, ostree_repo_path, error_msg, wd=None):
""" run provided command and log all of its output; set path to ostree repo """
logger.debug("running command %s", cmd)
kwargs = {
"stderr": subprocess.STDOUT,
"env": os.environ.copy(),
}
if ostr... | run provided command and log all of its output; set path to ostree repo | https://github.com/user-cont/colin/blob/00bb80e6e91522e15361935f813e8cf13d7e76dc/colin/core/target.py#L402-L420 |
user-cont/colin | colin/core/fmf_extension.py | ExtendedTree.__remove_append_items | def __remove_append_items(self, whole=False):
"""
internal method, delete all append items (ends with +)
:param whole: pass thru 'whole' param to climb
:return: None
"""
for node in self.climb(whole=whole):
for key in sorted(node.data.keys()):
... | python | def __remove_append_items(self, whole=False):
"""
internal method, delete all append items (ends with +)
:param whole: pass thru 'whole' param to climb
:return: None
"""
for node in self.climb(whole=whole):
for key in sorted(node.data.keys()):
... | internal method, delete all append items (ends with +)
:param whole: pass thru 'whole' param to climb
:return: None | https://github.com/user-cont/colin/blob/00bb80e6e91522e15361935f813e8cf13d7e76dc/colin/core/fmf_extension.py#L18-L27 |
user-cont/colin | colin/core/fmf_extension.py | ExtendedTree.references | def references(self, datatrees, whole=False):
"""
Reference name resolver (eg. /a/b/c/d@.x.y or /a/b/c/@y will search data in .x.y or y nodes)
there are used regular expressions (re.search) to match names
it uses simple references schema, do not use references to another references,
... | python | def references(self, datatrees, whole=False):
"""
Reference name resolver (eg. /a/b/c/d@.x.y or /a/b/c/@y will search data in .x.y or y nodes)
there are used regular expressions (re.search) to match names
it uses simple references schema, do not use references to another references,
... | Reference name resolver (eg. /a/b/c/d@.x.y or /a/b/c/@y will search data in .x.y or y nodes)
there are used regular expressions (re.search) to match names
it uses simple references schema, do not use references to another references,
avoid usind / in reference because actual solution creates als... | https://github.com/user-cont/colin/blob/00bb80e6e91522e15361935f813e8cf13d7e76dc/colin/core/fmf_extension.py#L29-L78 |
user-cont/colin | colin/core/fmf_extension.py | ExtendedTree.search | def search(self, name):
""" Search node with given name based on regexp, basic method (find) uses equality"""
for node in self.climb():
if re.search(name, node.name):
return node
return None | python | def search(self, name):
""" Search node with given name based on regexp, basic method (find) uses equality"""
for node in self.climb():
if re.search(name, node.name):
return node
return None | Search node with given name based on regexp, basic method (find) uses equality | https://github.com/user-cont/colin/blob/00bb80e6e91522e15361935f813e8cf13d7e76dc/colin/core/fmf_extension.py#L80-L85 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.login | def login(self, email, password):
"""Login to Todoist.
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response`
>>> fr... | python | def login(self, email, password):
"""Login to Todoist.
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response`
>>> fr... | Login to Todoist.
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response`
>>> from pytodoist.api import TodoistAPI
>>... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L36-L58 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.login_with_google | def login_with_google(self, email, oauth2_token, **kwargs):
"""Login to Todoist using Google's oauth2 authentication.
:param email: The user's Google email address.
:type email: str
:param oauth2_token: The user's Google oauth2 token.
:type oauth2_token: str
:param auto_... | python | def login_with_google(self, email, oauth2_token, **kwargs):
"""Login to Todoist using Google's oauth2 authentication.
:param email: The user's Google email address.
:type email: str
:param oauth2_token: The user's Google oauth2 token.
:type oauth2_token: str
:param auto_... | Login to Todoist using Google's oauth2 authentication.
:param email: The user's Google email address.
:type email: str
:param oauth2_token: The user's Google oauth2 token.
:type oauth2_token: str
:param auto_signup: If ``1`` register an account automatically.
:type auto_... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L60-L98 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.register | def register(self, email, full_name, password, **kwargs):
"""Register a new Todoist user.
:param email: The user's email.
:type email: str
:param full_name: The user's full name.
:type full_name: str
:param password: The user's password.
:type password: str
... | python | def register(self, email, full_name, password, **kwargs):
"""Register a new Todoist user.
:param email: The user's email.
:type email: str
:param full_name: The user's full name.
:type full_name: str
:param password: The user's password.
:type password: str
... | Register a new Todoist user.
:param email: The user's email.
:type email: str
:param full_name: The user's full name.
:type full_name: str
:param password: The user's password.
:type password: str
:param lang: The user's language.
:type lang: str
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L100-L130 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.delete_user | def delete_user(self, api_token, password, **kwargs):
"""Delete a registered Todoist user's account.
:param api_token: The user's login api_token.
:type api_token: str
:param password: The user's password.
:type password: str
:param reason_for_delete: The reason for dele... | python | def delete_user(self, api_token, password, **kwargs):
"""Delete a registered Todoist user's account.
:param api_token: The user's login api_token.
:type api_token: str
:param password: The user's password.
:type password: str
:param reason_for_delete: The reason for dele... | Delete a registered Todoist user's account.
:param api_token: The user's login api_token.
:type api_token: str
:param password: The user's password.
:type password: str
:param reason_for_delete: The reason for deletion.
:type reason_for_delete: str
:param in_back... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L132-L150 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.sync | def sync(self, api_token, sync_token, resource_types='["all"]', **kwargs):
"""Update and retrieve Todoist data.
:param api_token: The user's login api_token.
:type api_token: str
:param seq_no: The request sequence number. On initial request pass
``0``. On all others pass th... | python | def sync(self, api_token, sync_token, resource_types='["all"]', **kwargs):
"""Update and retrieve Todoist data.
:param api_token: The user's login api_token.
:type api_token: str
:param seq_no: The request sequence number. On initial request pass
``0``. On all others pass th... | Update and retrieve Todoist data.
:param api_token: The user's login api_token.
:type api_token: str
:param seq_no: The request sequence number. On initial request pass
``0``. On all others pass the last seq_no you received.
:type seq_no: int
:param seq_no_global: Th... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L152-L189 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.query | def query(self, api_token, queries, **kwargs):
"""Search all of a user's tasks using date, priority and label queries.
:param api_token: The user's login api_token.
:type api_token: str
:param queries: A JSON list of queries to search. See examples
`here <https://todoist.com... | python | def query(self, api_token, queries, **kwargs):
"""Search all of a user's tasks using date, priority and label queries.
:param api_token: The user's login api_token.
:type api_token: str
:param queries: A JSON list of queries to search. See examples
`here <https://todoist.com... | Search all of a user's tasks using date, priority and label queries.
:param api_token: The user's login api_token.
:type api_token: str
:param queries: A JSON list of queries to search. See examples
`here <https://todoist.com/Help/timeQuery>`_.
:type queries: list (str)
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L191-L208 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.add_item | def add_item(self, api_token, content, **kwargs):
"""Add a task to a project.
:param token: The user's login token.
:type token: str
:param content: The task description.
:type content: str
:param project_id: The project to add the task to. Default is ``Inbox``
:... | python | def add_item(self, api_token, content, **kwargs):
"""Add a task to a project.
:param token: The user's login token.
:type token: str
:param content: The task description.
:type content: str
:param project_id: The project to add the task to. Default is ``Inbox``
:... | Add a task to a project.
:param token: The user's login token.
:type token: str
:param content: The task description.
:type content: str
:param project_id: The project to add the task to. Default is ``Inbox``
:type project_id: str
:param date_string: The deadline... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L210-L260 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.quick_add | def quick_add(self, api_token, text, **kwargs):
"""Add a task using the Todoist 'Quick Add Task' syntax.
:param api_token: The user's login api_token.
:type api_token: str
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label... | python | def quick_add(self, api_token, text, **kwargs):
"""Add a task using the Todoist 'Quick Add Task' syntax.
:param api_token: The user's login api_token.
:type api_token: str
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label... | Add a task using the Todoist 'Quick Add Task' syntax.
:param api_token: The user's login api_token.
:type api_token: str
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label starts with a `@`
and an assignee starts with ... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L262-L282 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.get_all_completed_tasks | def get_all_completed_tasks(self, api_token, **kwargs):
"""Return a list of a user's completed tasks.
.. warning:: Requires Todoist premium.
:param api_token: The user's login api_token.
:type api_token: str
:param project_id: Filter the tasks by project.
:type project_... | python | def get_all_completed_tasks(self, api_token, **kwargs):
"""Return a list of a user's completed tasks.
.. warning:: Requires Todoist premium.
:param api_token: The user's login api_token.
:type api_token: str
:param project_id: Filter the tasks by project.
:type project_... | Return a list of a user's completed tasks.
.. warning:: Requires Todoist premium.
:param api_token: The user's login api_token.
:type api_token: str
:param project_id: Filter the tasks by project.
:type project_id: str
:param limit: The maximum number of tasks to return... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L284-L318 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.upload_file | def upload_file(self, api_token, file_path, **kwargs):
"""Upload a file suitable to be passed as a file_attachment.
:param api_token: The user's login api_token.
:type api_token: str
:param file_path: The path of the file to be uploaded.
:type file_path: str
:return: The... | python | def upload_file(self, api_token, file_path, **kwargs):
"""Upload a file suitable to be passed as a file_attachment.
:param api_token: The user's login api_token.
:type api_token: str
:param file_path: The path of the file to be uploaded.
:type file_path: str
:return: The... | Upload a file suitable to be passed as a file_attachment.
:param api_token: The user's login api_token.
:type api_token: str
:param file_path: The path of the file to be uploaded.
:type file_path: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Re... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L320-L336 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.get_productivity_stats | def get_productivity_stats(self, api_token, **kwargs):
"""Return a user's productivity stats.
:param api_token: The user's login api_token.
:type api_token: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response`
"""
params = {
... | python | def get_productivity_stats(self, api_token, **kwargs):
"""Return a user's productivity stats.
:param api_token: The user's login api_token.
:type api_token: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response`
"""
params = {
... | Return a user's productivity stats.
:param api_token: The user's login api_token.
:type api_token: str
:return: The HTTP response to the request.
:rtype: :class:`requests.Response` | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L338-L349 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.update_notification_settings | def update_notification_settings(self, api_token, event,
service, should_notify):
"""Update a user's notification settings.
:param api_token: The user's login api_token.
:type api_token: str
:param event: Update the notification settings of this even... | python | def update_notification_settings(self, api_token, event,
service, should_notify):
"""Update a user's notification settings.
:param api_token: The user's login api_token.
:type api_token: str
:param event: Update the notification settings of this even... | Update a user's notification settings.
:param api_token: The user's login api_token.
:type api_token: str
:param event: Update the notification settings of this event.
:type event: str
:param service: ``email`` or ``push``
:type service: str
:param should_notify:... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L351-L382 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI.get_redirect_link | def get_redirect_link(self, api_token, **kwargs):
"""Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:pa... | python | def get_redirect_link(self, api_token, **kwargs):
"""Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:pa... | Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:param api_token: The user's login api_token.
:type api_... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L384-L413 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI._get | def _get(self, end_point, params=None, **kwargs):
"""Send a HTTP GET request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param kwargs: Any optional param... | python | def _get(self, end_point, params=None, **kwargs):
"""Send a HTTP GET request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param kwargs: Any optional param... | Send a HTTP GET request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param kwargs: Any optional parameters.
:type kwargs: dict
:return: The HTTP r... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L415-L427 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI._post | def _post(self, end_point, params=None, files=None, **kwargs):
"""Send a HTTP POST request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param files: Any f... | python | def _post(self, end_point, params=None, files=None, **kwargs):
"""Send a HTTP POST request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param files: Any f... | Send a HTTP POST request to a Todoist API end-point.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required request parameters.
:type params: dict
:param files: Any files that are being sent as multipart/form-data.
:type files: dict... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L429-L443 |
Garee/pytodoist | pytodoist/api.py | TodoistAPI._request | def _request(self, req_func, end_point, params=None, files=None, **kwargs):
"""Send a HTTP request to a Todoist API end-point.
:param req_func: The request function to use e.g. get or post.
:type req_func: A request function from the :class:`requests` module.
:param end_point: The Todoi... | python | def _request(self, req_func, end_point, params=None, files=None, **kwargs):
"""Send a HTTP request to a Todoist API end-point.
:param req_func: The request function to use e.g. get or post.
:type req_func: A request function from the :class:`requests` module.
:param end_point: The Todoi... | Send a HTTP request to a Todoist API end-point.
:param req_func: The request function to use e.g. get or post.
:type req_func: A request function from the :class:`requests` module.
:param end_point: The Todoist API end-point.
:type end_point: str
:param params: The required requ... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/api.py#L445-L464 |
Garee/pytodoist | pytodoist/todoist.py | login | def login(email, password):
"""Login to Todoist.
:param email: A Todoist user's email address.
:type email: str
:param password: A Todoist user's password.
:type password: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist import todoist
>>> u... | python | def login(email, password):
"""Login to Todoist.
:param email: A Todoist user's email address.
:type email: str
:param password: A Todoist user's password.
:type password: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist import todoist
>>> u... | Login to Todoist.
:param email: A Todoist user's email address.
:type email: str
:param password: A Todoist user's password.
:type password: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L30-L47 |
Garee/pytodoist | pytodoist/todoist.py | login_with_api_token | def login_with_api_token(api_token):
"""Login to Todoist using a user's api token.
.. note:: It is up to you to obtain the api token.
:param api_token: A Todoist user's api token.
:type api_token: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist im... | python | def login_with_api_token(api_token):
"""Login to Todoist using a user's api token.
.. note:: It is up to you to obtain the api token.
:param api_token: A Todoist user's api token.
:type api_token: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist im... | Login to Todoist using a user's api token.
.. note:: It is up to you to obtain the api token.
:param api_token: A Todoist user's api token.
:type api_token: str
:return: The Todoist user.
:rtype: :class:`pytodoist.todoist.User`
>>> from pytodoist import todoist
>>> api_token = 'api_token'... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L71-L92 |
Garee/pytodoist | pytodoist/todoist.py | _login | def _login(login_func, *args):
"""A helper function for logging in. It's purpose is to avoid duplicate
code in the login functions.
"""
response = login_func(*args)
_fail_if_contains_errors(response)
user_json = response.json()
return User(user_json) | python | def _login(login_func, *args):
"""A helper function for logging in. It's purpose is to avoid duplicate
code in the login functions.
"""
response = login_func(*args)
_fail_if_contains_errors(response)
user_json = response.json()
return User(user_json) | A helper function for logging in. It's purpose is to avoid duplicate
code in the login functions. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L95-L102 |
Garee/pytodoist | pytodoist/todoist.py | register | def register(full_name, email, password, lang=None, timezone=None):
"""Register a new Todoist account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:param l... | python | def register(full_name, email, password, lang=None, timezone=None):
"""Register a new Todoist account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:param l... | Register a new Todoist account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:param password: The user's password.
:type password: str
:param lang: The user's language.
:type lang: str
:param timezone: The user... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L105-L132 |
Garee/pytodoist | pytodoist/todoist.py | register_with_google | def register_with_google(full_name, email, oauth2_token,
lang=None, timezone=None):
"""Register a new Todoist account by linking a Google account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:para... | python | def register_with_google(full_name, email, oauth2_token,
lang=None, timezone=None):
"""Register a new Todoist account by linking a Google account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:para... | Register a new Todoist account by linking a Google account.
:param full_name: The user's full name.
:type full_name: str
:param email: The user's email address.
:type email: str
:param oauth2_token: The oauth2 token associated with the email.
:type oauth2_token: str
:param lang: The user's ... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L135-L167 |
Garee/pytodoist | pytodoist/todoist.py | _fail_if_contains_errors | def _fail_if_contains_errors(response, sync_uuid=None):
"""Raise a RequestError Exception if a given response
does not denote a successful request.
"""
if response.status_code != _HTTP_OK:
raise RequestError(response)
response_json = response.json()
if sync_uuid and 'sync_status' in resp... | python | def _fail_if_contains_errors(response, sync_uuid=None):
"""Raise a RequestError Exception if a given response
does not denote a successful request.
"""
if response.status_code != _HTTP_OK:
raise RequestError(response)
response_json = response.json()
if sync_uuid and 'sync_status' in resp... | Raise a RequestError Exception if a given response
does not denote a successful request. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L170-L180 |
Garee/pytodoist | pytodoist/todoist.py | _perform_command | def _perform_command(user, command_type, command_args):
"""Perform an operation on Todoist using the API sync end-point."""
command_uuid = _gen_uuid()
command = {
'type': command_type,
'args': command_args,
'uuid': command_uuid,
'temp_id': _gen_uuid()
}
commands = jso... | python | def _perform_command(user, command_type, command_args):
"""Perform an operation on Todoist using the API sync end-point."""
command_uuid = _gen_uuid()
command = {
'type': command_type,
'args': command_args,
'uuid': command_uuid,
'temp_id': _gen_uuid()
}
commands = jso... | Perform an operation on Todoist using the API sync end-point. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L188-L201 |
Garee/pytodoist | pytodoist/todoist.py | User.update | def update(self):
"""Update the user's details on Todoist.
This method must be called to register any local attribute changes
with Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> user.full_name = 'John Smith'
... | python | def update(self):
"""Update the user's details on Todoist.
This method must be called to register any local attribute changes
with Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> user.full_name = 'John Smith'
... | Update the user's details on Todoist.
This method must be called to register any local attribute changes
with Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> user.full_name = 'John Smith'
>>> # At this point Todo... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L313-L327 |
Garee/pytodoist | pytodoist/todoist.py | User.sync | def sync(self, resource_types='["all"]'):
"""Synchronize the user's data with the Todoist server.
This function will pull data from the Todoist server and update the
state of the user object such that they match. It does not *push* data
to Todoist. If you want to do that use
:fu... | python | def sync(self, resource_types='["all"]'):
"""Synchronize the user's data with the Todoist server.
This function will pull data from the Todoist server and update the
state of the user object such that they match. It does not *push* data
to Todoist. If you want to do that use
:fu... | Synchronize the user's data with the Todoist server.
This function will pull data from the Todoist server and update the
state of the user object such that they match. It does not *push* data
to Todoist. If you want to do that use
:func:`pytodoist.todoist.User.update`.
:param r... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L329-L358 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_projects | def _sync_projects(self, projects_json):
""""Populate the user's projects from a JSON encoded list."""
for project_json in projects_json:
project_id = project_json['id']
self.projects[project_id] = Project(project_json, self) | python | def _sync_projects(self, projects_json):
""""Populate the user's projects from a JSON encoded list."""
for project_json in projects_json:
project_id = project_json['id']
self.projects[project_id] = Project(project_json, self) | Populate the user's projects from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L360-L364 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_tasks | def _sync_tasks(self, tasks_json):
""""Populate the user's tasks from a JSON encoded list."""
for task_json in tasks_json:
task_id = task_json['id']
project_id = task_json['project_id']
if project_id not in self.projects:
# ignore orphan tasks
... | python | def _sync_tasks(self, tasks_json):
""""Populate the user's tasks from a JSON encoded list."""
for task_json in tasks_json:
task_id = task_json['id']
project_id = task_json['project_id']
if project_id not in self.projects:
# ignore orphan tasks
... | Populate the user's tasks from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L366-L375 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_notes | def _sync_notes(self, notes_json):
""""Populate the user's notes from a JSON encoded list."""
for note_json in notes_json:
note_id = note_json['id']
task_id = note_json['item_id']
if task_id not in self.tasks:
# ignore orphan notes
cont... | python | def _sync_notes(self, notes_json):
""""Populate the user's notes from a JSON encoded list."""
for note_json in notes_json:
note_id = note_json['id']
task_id = note_json['item_id']
if task_id not in self.tasks:
# ignore orphan notes
cont... | Populate the user's notes from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L377-L386 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_labels | def _sync_labels(self, labels_json):
""""Populate the user's labels from a JSON encoded list."""
for label_json in labels_json:
label_id = label_json['id']
self.labels[label_id] = Label(label_json, self) | python | def _sync_labels(self, labels_json):
""""Populate the user's labels from a JSON encoded list."""
for label_json in labels_json:
label_id = label_json['id']
self.labels[label_id] = Label(label_json, self) | Populate the user's labels from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L388-L392 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_filters | def _sync_filters(self, filters_json):
""""Populate the user's filters from a JSON encoded list."""
for filter_json in filters_json:
filter_id = filter_json['id']
self.filters[filter_id] = Filter(filter_json, self) | python | def _sync_filters(self, filters_json):
""""Populate the user's filters from a JSON encoded list."""
for filter_json in filters_json:
filter_id = filter_json['id']
self.filters[filter_id] = Filter(filter_json, self) | Populate the user's filters from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L394-L398 |
Garee/pytodoist | pytodoist/todoist.py | User._sync_reminders | def _sync_reminders(self, reminders_json):
""""Populate the user's reminders from a JSON encoded list."""
for reminder_json in reminders_json:
reminder_id = reminder_json['id']
task_id = reminder_json['item_id']
if task_id not in self.tasks:
# ignore o... | python | def _sync_reminders(self, reminders_json):
""""Populate the user's reminders from a JSON encoded list."""
for reminder_json in reminders_json:
reminder_id = reminder_json['id']
task_id = reminder_json['item_id']
if task_id not in self.tasks:
# ignore o... | Populate the user's reminders from a JSON encoded list. | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L400-L409 |
Garee/pytodoist | pytodoist/todoist.py | User.quick_add | def quick_add(self, text, note=None, reminder=None):
"""Add a task using the 'Quick Add Task' syntax.
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label starts with a `@`
and an assignee starts with a `+`.
:type text: ... | python | def quick_add(self, text, note=None, reminder=None):
"""Add a task using the 'Quick Add Task' syntax.
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label starts with a `@`
and an assignee starts with a `+`.
:type text: ... | Add a task using the 'Quick Add Task' syntax.
:param text: The text of the task that is parsed. A project
name starts with the `#` character, a label starts with a `@`
and an assignee starts with a `+`.
:type text: str
:param note: The content of the note.
:type ... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L411-L435 |
Garee/pytodoist | pytodoist/todoist.py | User.add_project | def add_project(self, name, color=None, indent=None, order=None):
"""Add a project to the user's account.
:param name: The project name.
:type name: str
:return: The project that was added.
:rtype: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
... | python | def add_project(self, name, color=None, indent=None, order=None):
"""Add a project to the user's account.
:param name: The project name.
:type name: str
:return: The project that was added.
:rtype: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
... | Add a project to the user's account.
:param name: The project name.
:type name: str
:return: The project that was added.
:rtype: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> p... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L437-L459 |
Garee/pytodoist | pytodoist/todoist.py | User.get_project | def get_project(self, project_name):
"""Return the project with a given name.
:param project_name: The name to search for.
:type project_name: str
:return: The project that has the name ``project_name`` or ``None``
if no project is found.
:rtype: :class:`pytodoist.to... | python | def get_project(self, project_name):
"""Return the project with a given name.
:param project_name: The name to search for.
:type project_name: str
:return: The project that has the name ``project_name`` or ``None``
if no project is found.
:rtype: :class:`pytodoist.to... | Return the project with a given name.
:param project_name: The name to search for.
:type project_name: str
:return: The project that has the name ``project_name`` or ``None``
if no project is found.
:rtype: :class:`pytodoist.todoist.Project`
>>> from pytodoist impor... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L461-L478 |
Garee/pytodoist | pytodoist/todoist.py | User.get_uncompleted_tasks | def get_uncompleted_tasks(self):
"""Return all of a user's uncompleted tasks.
.. warning:: Requires Todoist premium.
:return: A list of uncompleted tasks.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.d... | python | def get_uncompleted_tasks(self):
"""Return all of a user's uncompleted tasks.
.. warning:: Requires Todoist premium.
:return: A list of uncompleted tasks.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.d... | Return all of a user's uncompleted tasks.
.. warning:: Requires Todoist premium.
:return: A list of uncompleted tasks.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> uncom... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L515-L530 |
Garee/pytodoist | pytodoist/todoist.py | User.search_tasks | def search_tasks(self, *queries):
"""Return a list of tasks that match some search criteria.
.. note:: Example queries can be found
`here <https://todoist.com/Help/timeQuery>`_.
.. note:: A standard set of queries are available
in the :class:`pytodoist.todoist.Query` cl... | python | def search_tasks(self, *queries):
"""Return a list of tasks that match some search criteria.
.. note:: Example queries can be found
`here <https://todoist.com/Help/timeQuery>`_.
.. note:: A standard set of queries are available
in the :class:`pytodoist.todoist.Query` cl... | Return a list of tasks that match some search criteria.
.. note:: Example queries can be found
`here <https://todoist.com/Help/timeQuery>`_.
.. note:: A standard set of queries are available
in the :class:`pytodoist.todoist.Query` class.
:param queries: Return tasks th... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L562-L600 |
Garee/pytodoist | pytodoist/todoist.py | User.add_label | def add_label(self, name, color=None):
"""Create a new label.
.. warning:: Requires Todoist premium.
:param name: The name of the label.
:type name: str
:param color: The color of the label.
:type color: str
:return: The newly created label.
:rtype: :cla... | python | def add_label(self, name, color=None):
"""Create a new label.
.. warning:: Requires Todoist premium.
:param name: The name of the label.
:type name: str
:param color: The color of the label.
:type color: str
:return: The newly created label.
:rtype: :cla... | Create a new label.
.. warning:: Requires Todoist premium.
:param name: The name of the label.
:type name: str
:param color: The color of the label.
:type color: str
:return: The newly created label.
:rtype: :class:`pytodoist.todoist.Label`
>>> from pyt... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L602-L623 |
Garee/pytodoist | pytodoist/todoist.py | User.get_label | def get_label(self, label_name):
"""Return the user's label that has a given name.
:param label_name: The name to search for.
:type label_name: str
:return: A label that has a matching name or ``None`` if not found.
:rtype: :class:`pytodoist.todoist.Label`
>>> from pyto... | python | def get_label(self, label_name):
"""Return the user's label that has a given name.
:param label_name: The name to search for.
:type label_name: str
:return: A label that has a matching name or ``None`` if not found.
:rtype: :class:`pytodoist.todoist.Label`
>>> from pyto... | Return the user's label that has a given name.
:param label_name: The name to search for.
:type label_name: str
:return: A label that has a matching name or ``None`` if not found.
:rtype: :class:`pytodoist.todoist.Label`
>>> from pytodoist import todoist
>>> user = todo... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L625-L639 |
Garee/pytodoist | pytodoist/todoist.py | User.add_filter | def add_filter(self, name, query, color=None, item_order=None):
"""Create a new filter.
.. warning:: Requires Todoist premium.
:param name: The name of the filter.
:param query: The query to search for.
:param color: The color of the filter.
:param item_order: The filte... | python | def add_filter(self, name, query, color=None, item_order=None):
"""Create a new filter.
.. warning:: Requires Todoist premium.
:param name: The name of the filter.
:param query: The query to search for.
:param color: The color of the filter.
:param item_order: The filte... | Create a new filter.
.. warning:: Requires Todoist premium.
:param name: The name of the filter.
:param query: The query to search for.
:param color: The color of the filter.
:param item_order: The filter's order in the filter list.
:return: The newly created filter.
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L667-L690 |
Garee/pytodoist | pytodoist/todoist.py | User.get_filter | def get_filter(self, name):
"""Return the filter that has the given filter name.
:param name: The name to search for.
:return: The filter with the given name.
:rtype: :class:`pytodoist.todoist.Filter`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@... | python | def get_filter(self, name):
"""Return the filter that has the given filter name.
:param name: The name to search for.
:return: The filter with the given name.
:rtype: :class:`pytodoist.todoist.Filter`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@... | Return the filter that has the given filter name.
:param name: The name to search for.
:return: The filter with the given name.
:rtype: :class:`pytodoist.todoist.Filter`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> use... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L692-L706 |
Garee/pytodoist | pytodoist/todoist.py | User._update_notification_settings | def _update_notification_settings(self, event, service,
should_notify):
"""Update the settings of a an events notifications.
:param event: Update the notification settings of this event.
:type event: str
:param service: The notification service to u... | python | def _update_notification_settings(self, event, service,
should_notify):
"""Update the settings of a an events notifications.
:param event: Update the notification settings of this event.
:type event: str
:param service: The notification service to u... | Update the settings of a an events notifications.
:param event: Update the notification settings of this event.
:type event: str
:param service: The notification service to update.
:type service: str
:param should_notify: Notify if this is ``1``.
:type should_notify: int | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L743-L756 |
Garee/pytodoist | pytodoist/todoist.py | User.get_productivity_stats | def get_productivity_stats(self):
"""Return the user's productivity stats.
:return: A JSON-encoded representation of the user's productivity
stats.
:rtype: A JSON-encoded object.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'passw... | python | def get_productivity_stats(self):
"""Return the user's productivity stats.
:return: A JSON-encoded representation of the user's productivity
stats.
:rtype: A JSON-encoded object.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'passw... | Return the user's productivity stats.
:return: A JSON-encoded representation of the user's productivity
stats.
:rtype: A JSON-encoded object.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> stats = user.get_productivi... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L806-L821 |
Garee/pytodoist | pytodoist/todoist.py | User.get_redirect_link | def get_redirect_link(self):
"""Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:return: The user's redi... | python | def get_redirect_link(self):
"""Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:return: The user's redi... | Return the absolute URL to redirect or to open in
a browser. The first time the link is used it logs in the user
automatically and performs a redirect to a given page. Once used,
the link keeps working as a plain redirect.
:return: The user's redirect link.
:rtype: str
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L889-L906 |
Garee/pytodoist | pytodoist/todoist.py | User.delete | def delete(self, reason=None):
"""Delete the user's account from Todoist.
.. warning:: You cannot recover the user after deletion!
:param reason: The reason for deletion.
:type reason: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com',... | python | def delete(self, reason=None):
"""Delete the user's account from Todoist.
.. warning:: You cannot recover the user after deletion!
:param reason: The reason for deletion.
:type reason: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com',... | Delete the user's account from Todoist.
.. warning:: You cannot recover the user after deletion!
:param reason: The reason for deletion.
:type reason: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> user.delete()
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L908-L923 |
Garee/pytodoist | pytodoist/todoist.py | Project.archive | def archive(self):
"""Archive the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.archive()
"""
args = {'id': self.id}
_perform_command(self.owne... | python | def archive(self):
"""Archive the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.archive()
"""
args = {'id': self.id}
_perform_command(self.owne... | Archive the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.archive() | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L982-L992 |
Garee/pytodoist | pytodoist/todoist.py | Project.add_task | def add_task(self, content, date=None, priority=None):
"""Add a task to the project
:param content: The task description.
:type content: str
:param date: The task deadline.
:type date: str
:param priority: The priority of the task.
:type priority: int
:re... | python | def add_task(self, content, date=None, priority=None):
"""Add a task to the project
:param content: The task description.
:type content: str
:param date: The task deadline.
:type date: str
:param priority: The priority of the task.
:type priority: int
:re... | Add a task to the project
:param content: The task description.
:type content: str
:param date: The task deadline.
:type date: str
:param priority: The priority of the task.
:type priority: int
:return: The added task.
:rtype: :class:`pytodoist.todoist.Ta... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1016-L1042 |
Garee/pytodoist | pytodoist/todoist.py | Project.get_uncompleted_tasks | def get_uncompleted_tasks(self):
"""Return a list of all uncompleted tasks in this project.
.. warning:: Requires Todoist premium.
:return: A list of all uncompleted tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
... | python | def get_uncompleted_tasks(self):
"""Return a list of all uncompleted tasks in this project.
.. warning:: Requires Todoist premium.
:return: A list of all uncompleted tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
... | Return a list of all uncompleted tasks in this project.
.. warning:: Requires Todoist premium.
:return: A list of all uncompleted tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.c... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1044-L1062 |
Garee/pytodoist | pytodoist/todoist.py | Project.get_completed_tasks | def get_completed_tasks(self):
"""Return a list of all completed tasks in this project.
:return: A list of all completed tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'pass... | python | def get_completed_tasks(self):
"""Return a list of all completed tasks in this project.
:return: A list of all completed tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'pass... | Return a list of all completed tasks in this project.
:return: A list of all completed tasks in this project.
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_proj... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1064-L1096 |
Garee/pytodoist | pytodoist/todoist.py | Project.get_tasks | def get_tasks(self):
"""Return all tasks in this project.
:return: A list of all tasks in this project.class
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.g... | python | def get_tasks(self):
"""Return all tasks in this project.
:return: A list of all tasks in this project.class
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.g... | Return all tasks in this project.
:return: A list of all tasks in this project.class
:rtype: list of :class:`pytodoist.todoist.Task`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1098-L1117 |
Garee/pytodoist | pytodoist/todoist.py | Project.add_note | def add_note(self, content):
"""Add a note to the project.
.. warning:: Requires Todoist premium.
:param content: The note content.
:type content: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = use... | python | def add_note(self, content):
"""Add a note to the project.
.. warning:: Requires Todoist premium.
:param content: The note content.
:type content: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = use... | Add a note to the project.
.. warning:: Requires Todoist premium.
:param content: The note content.
:type content: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> p... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1119-L1136 |
Garee/pytodoist | pytodoist/todoist.py | Project.get_notes | def get_notes(self):
"""Return a list of all of the project's notes.
:return: A list of notes.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('Py... | python | def get_notes(self):
"""Return a list of all of the project's notes.
:return: A list of notes.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('Py... | Return a list of all of the project's notes.
:return: A list of notes.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> notes = pr... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1138-L1151 |
Garee/pytodoist | pytodoist/todoist.py | Project.share | def share(self, email, message=None):
"""Share the project with another Todoist user.
:param email: The other user's email address.
:type email: str
:param message: Optional message to send with the invitation.
:type message: str
>>> from pytodoist import todoist
... | python | def share(self, email, message=None):
"""Share the project with another Todoist user.
:param email: The other user's email address.
:type email: str
:param message: Optional message to send with the invitation.
:type message: str
>>> from pytodoist import todoist
... | Share the project with another Todoist user.
:param email: The other user's email address.
:type email: str
:param message: Optional message to send with the invitation.
:type message: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', ... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1153-L1171 |
Garee/pytodoist | pytodoist/todoist.py | Project.delete_collaborator | def delete_collaborator(self, email):
"""Remove a collaborating user from the shared project.
:param email: The collaborator's email address.
:type email: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user... | python | def delete_collaborator(self, email):
"""Remove a collaborating user from the shared project.
:param email: The collaborator's email address.
:type email: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user... | Remove a collaborating user from the shared project.
:param email: The collaborator's email address.
:type email: str
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.del... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1173-L1188 |
Garee/pytodoist | pytodoist/todoist.py | Project.delete | def delete(self):
"""Delete the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.delete()
"""
args = {'ids': [self.id]}
_perform_command(self.owne... | python | def delete(self):
"""Delete the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.delete()
"""
args = {'ids': [self.id]}
_perform_command(self.owne... | Delete the project.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> project.delete() | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1203-L1213 |
Garee/pytodoist | pytodoist/todoist.py | Task.complete | def complete(self):
"""Mark the task complete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.complete()
"""
... | python | def complete(self):
"""Mark the task complete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.complete()
"""
... | Mark the task complete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.complete() | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1296-L1308 |
Garee/pytodoist | pytodoist/todoist.py | Task.uncomplete | def uncomplete(self):
"""Mark the task uncomplete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.uncomplete()
"""
... | python | def uncomplete(self):
"""Mark the task uncomplete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.uncomplete()
"""
... | Mark the task uncomplete.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.uncomplete() | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1310-L1324 |
Garee/pytodoist | pytodoist/todoist.py | Task.get_notes | def get_notes(self):
"""Return all notes attached to this Task.
:return: A list of all notes attached to this Task.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project =... | python | def get_notes(self):
"""Return all notes attached to this Task.
:return: A list of all notes attached to this Task.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project =... | Return all notes attached to this Task.
:return: A list of all notes attached to this Task.
:rtype: list of :class:`pytodoist.todoist.Note`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1350-L1367 |
Garee/pytodoist | pytodoist/todoist.py | Task.move | def move(self, project):
"""Move this task to another project.
:param project: The project to move the task to.
:type project: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = u... | python | def move(self, project):
"""Move this task to another project.
:param project: The project to move the task to.
:type project: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = u... | Move this task to another project.
:param project: The project to move the task to.
:type project: :class:`pytodoist.todoist.Project`
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1369-L1391 |
Garee/pytodoist | pytodoist/todoist.py | Task.add_date_reminder | def add_date_reminder(self, service, due_date):
"""Add a reminder to the task which activates on a given date.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param due_date: The due date in UTC, format... | python | def add_date_reminder(self, service, due_date):
"""Add a reminder to the task which activates on a given date.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param due_date: The due date in UTC, format... | Add a reminder to the task which activates on a given date.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param due_date: The due date in UTC, formatted as
```YYYY-MM-DDTHH:MM```
:type due... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1393-L1416 |
Garee/pytodoist | pytodoist/todoist.py | Task.add_location_reminder | def add_location_reminder(self, service, name, lat, long, trigger, radius):
"""Add a reminder to the task which activates on at a given location.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param na... | python | def add_location_reminder(self, service, name, lat, long, trigger, radius):
"""Add a reminder to the task which activates on at a given location.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param na... | Add a reminder to the task which activates on at a given location.
.. warning:: Requires Todoist premium.
:param service: ```email```, ```sms``` or ```push``` for mobile.
:type service: str
:param name: An alias for the location.
:type name: str
:param lat: The location... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1418-L1454 |
Garee/pytodoist | pytodoist/todoist.py | Task.get_reminders | def get_reminders(self):
"""Return a list of the task's reminders.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.add_date_... | python | def get_reminders(self):
"""Return a list of the task's reminders.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.add_date_... | Return a list of the task's reminders.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist')
>>> task.add_date_reminder('email', '2015-12-01T09:00'... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1456-L1467 |
Garee/pytodoist | pytodoist/todoist.py | Task.delete | def delete(self):
"""Delete the task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('Homework')
>>> task = project.add_task('Read Chapter 4')
>>> task.delete()
"""
args = {'ids'... | python | def delete(self):
"""Delete the task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('Homework')
>>> task = project.add_task('Read Chapter 4')
>>> task.delete()
"""
args = {'ids'... | Delete the task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('Homework')
>>> task = project.add_task('Read Chapter 4')
>>> task.delete() | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1469-L1480 |
Garee/pytodoist | pytodoist/todoist.py | Note.delete | def delete(self):
"""Delete the note, removing it from it's task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist.')
>>> note = task.ad... | python | def delete(self):
"""Delete the note, removing it from it's task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist.')
>>> note = task.ad... | Delete the note, removing it from it's task.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> project = user.get_project('PyTodoist')
>>> task = project.add_task('Install PyTodoist.')
>>> note = task.add_note('https://pypi.python.o... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1535-L1550 |
Garee/pytodoist | pytodoist/todoist.py | Filter.update | def update(self):
"""Update the filter's details on Todoist.
You must call this method to register any local attribute changes with
Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> overdue_filter = user.add_filter... | python | def update(self):
"""Update the filter's details on Todoist.
You must call this method to register any local attribute changes with
Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> overdue_filter = user.add_filter... | Update the filter's details on Todoist.
You must call this method to register any local attribute changes with
Todoist.
>>> from pytodoist import todoist
>>> user = todoist.login('john.doe@gmail.com', 'password')
>>> overdue_filter = user.add_filter('Overdue', todoist.Query.OVE... | https://github.com/Garee/pytodoist/blob/3359cbff485ebdbbb4ffbd58d71e21a817874dd7/pytodoist/todoist.py#L1634-L1650 |
pavlov99/json-rpc | jsonrpc/utils.py | is_invalid_params_py2 | def is_invalid_params_py2(func, *args, **kwargs):
""" Check, whether function 'func' accepts parameters 'args', 'kwargs'.
NOTE: Method is called after funct(*args, **kwargs) generated TypeError,
it is aimed to destinguish TypeError because of invalid parameters from
TypeError from inside the function.
... | python | def is_invalid_params_py2(func, *args, **kwargs):
""" Check, whether function 'func' accepts parameters 'args', 'kwargs'.
NOTE: Method is called after funct(*args, **kwargs) generated TypeError,
it is aimed to destinguish TypeError because of invalid parameters from
TypeError from inside the function.
... | Check, whether function 'func' accepts parameters 'args', 'kwargs'.
NOTE: Method is called after funct(*args, **kwargs) generated TypeError,
it is aimed to destinguish TypeError because of invalid parameters from
TypeError from inside the function.
.. versionadded: 1.9.0 | https://github.com/pavlov99/json-rpc/blob/c6d0f0532575e6e4088f2994f8ad93bc4fc11ecb/jsonrpc/utils.py#L57-L82 |
pavlov99/json-rpc | jsonrpc/utils.py | is_invalid_params_py3 | def is_invalid_params_py3(func, *args, **kwargs):
"""
Use inspect.signature instead of inspect.getargspec or
inspect.getfullargspec (based on inspect.signature itself) as it provides
more information about function parameters.
.. versionadded: 1.11.2
"""
signature = inspect.signature(func)... | python | def is_invalid_params_py3(func, *args, **kwargs):
"""
Use inspect.signature instead of inspect.getargspec or
inspect.getfullargspec (based on inspect.signature itself) as it provides
more information about function parameters.
.. versionadded: 1.11.2
"""
signature = inspect.signature(func)... | Use inspect.signature instead of inspect.getargspec or
inspect.getfullargspec (based on inspect.signature itself) as it provides
more information about function parameters.
.. versionadded: 1.11.2 | https://github.com/pavlov99/json-rpc/blob/c6d0f0532575e6e4088f2994f8ad93bc4fc11ecb/jsonrpc/utils.py#L85-L110 |
pavlov99/json-rpc | jsonrpc/utils.py | is_invalid_params | def is_invalid_params(func, *args, **kwargs):
"""
Method:
Validate pre-defined criteria, if any is True - function is invalid
0. func should be callable
1. kwargs should not have unexpected keywords
2. remove kwargs.keys from func.parameters
3. number of args should be <=... | python | def is_invalid_params(func, *args, **kwargs):
"""
Method:
Validate pre-defined criteria, if any is True - function is invalid
0. func should be callable
1. kwargs should not have unexpected keywords
2. remove kwargs.keys from func.parameters
3. number of args should be <=... | Method:
Validate pre-defined criteria, if any is True - function is invalid
0. func should be callable
1. kwargs should not have unexpected keywords
2. remove kwargs.keys from func.parameters
3. number of args should be <= remaining func.parameters
4. number of args shoul... | https://github.com/pavlov99/json-rpc/blob/c6d0f0532575e6e4088f2994f8ad93bc4fc11ecb/jsonrpc/utils.py#L113-L135 |
pavlov99/json-rpc | jsonrpc/dispatcher.py | Dispatcher.add_method | def add_method(self, f=None, name=None):
""" Add a method to the dispatcher.
Parameters
----------
f : callable
Callable to be added.
name : str, optional
Name to register (the default is function **f** name)
Notes
-----
When used... | python | def add_method(self, f=None, name=None):
""" Add a method to the dispatcher.
Parameters
----------
f : callable
Callable to be added.
name : str, optional
Name to register (the default is function **f** name)
Notes
-----
When used... | Add a method to the dispatcher.
Parameters
----------
f : callable
Callable to be added.
name : str, optional
Name to register (the default is function **f** name)
Notes
-----
When used as a decorator keeps callable object unmodified.
... | https://github.com/pavlov99/json-rpc/blob/c6d0f0532575e6e4088f2994f8ad93bc4fc11ecb/jsonrpc/dispatcher.py#L67-L108 |
Robpol86/colorclass | setup.py | readme | def readme():
"""Try to read README.rst or return empty string if failed.
:return: File contents.
:rtype: str
"""
path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'README.rst'))
handle = None
try:
handle = codecs.open(path, encoding='utf-8')
return handle.read... | python | def readme():
"""Try to read README.rst or return empty string if failed.
:return: File contents.
:rtype: str
"""
path = os.path.realpath(os.path.join(os.path.dirname(__file__), 'README.rst'))
handle = None
try:
handle = codecs.open(path, encoding='utf-8')
return handle.read... | Try to read README.rst or return empty string if failed.
:return: File contents.
:rtype: str | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/setup.py#L12-L26 |
Robpol86/colorclass | colorclass/core.py | apply_text | def apply_text(incoming, func):
"""Call `func` on text portions of incoming color string.
:param iter incoming: Incoming string/ColorStr/string-like object to iterate.
:param func: Function to call with string portion as first and only parameter.
:return: Modified string, same class type as incoming s... | python | def apply_text(incoming, func):
"""Call `func` on text portions of incoming color string.
:param iter incoming: Incoming string/ColorStr/string-like object to iterate.
:param func: Function to call with string portion as first and only parameter.
:return: Modified string, same class type as incoming s... | Call `func` on text portions of incoming color string.
:param iter incoming: Incoming string/ColorStr/string-like object to iterate.
:param func: Function to call with string portion as first and only parameter.
:return: Modified string, same class type as incoming string. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L10-L23 |
Robpol86/colorclass | colorclass/core.py | ColorBytes.decode | def decode(self, encoding='utf-8', errors='strict'):
"""Decode using the codec registered for encoding. Default encoding is 'utf-8'.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possible values a... | python | def decode(self, encoding='utf-8', errors='strict'):
"""Decode using the codec registered for encoding. Default encoding is 'utf-8'.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possible values a... | Decode using the codec registered for encoding. Default encoding is 'utf-8'.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' as well as any other name
regi... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L37-L48 |
Robpol86/colorclass | colorclass/core.py | ColorStr.center | def center(self, width, fillchar=None):
"""Return centered in a string of length width. Padding is done using the specified fill character or space.
:param int width: Length of output string.
:param str fillchar: Use this character instead of spaces.
"""
if fillchar is not None:... | python | def center(self, width, fillchar=None):
"""Return centered in a string of length width. Padding is done using the specified fill character or space.
:param int width: Length of output string.
:param str fillchar: Use this character instead of spaces.
"""
if fillchar is not None:... | Return centered in a string of length width. Padding is done using the specified fill character or space.
:param int width: Length of output string.
:param str fillchar: Use this character instead of spaces. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L111-L121 |
Robpol86/colorclass | colorclass/core.py | ColorStr.count | def count(self, sub, start=0, end=-1):
"""Return the number of non-overlapping occurrences of substring sub in string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginning position.
:p... | python | def count(self, sub, start=0, end=-1):
"""Return the number of non-overlapping occurrences of substring sub in string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginning position.
:p... | Return the number of non-overlapping occurrences of substring sub in string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L123-L132 |
Robpol86/colorclass | colorclass/core.py | ColorStr.endswith | def endswith(self, suffix, start=0, end=None):
"""Return True if ends with the specified suffix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position.
suffix can also be a tuple of strings to try.
:param str suffix: S... | python | def endswith(self, suffix, start=0, end=None):
"""Return True if ends with the specified suffix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position.
suffix can also be a tuple of strings to try.
:param str suffix: S... | Return True if ends with the specified suffix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position.
suffix can also be a tuple of strings to try.
:param str suffix: Suffix to search.
:param int start: Beginning posit... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L134-L145 |
Robpol86/colorclass | colorclass/core.py | ColorStr.encode | def encode(self, encoding=None, errors='strict'):
"""Encode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeEncodeError. Other possib... | python | def encode(self, encoding=None, errors='strict'):
"""Encode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeEncodeError. Other possib... | Encode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and 'xmlcharrefreplace' as ... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L147-L157 |
Robpol86/colorclass | colorclass/core.py | ColorStr.decode | def decode(self, encoding=None, errors='strict'):
"""Decode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possib... | python | def decode(self, encoding=None, errors='strict'):
"""Decode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possib... | Decode using the codec registered for encoding. encoding defaults to the default encoding.
errors may be given to set a different error handling scheme. Default is 'strict' meaning that encoding errors
raise a UnicodeDecodeError. Other possible values are 'ignore' and 'replace' as well as any other nam... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L159-L169 |
Robpol86/colorclass | colorclass/core.py | ColorStr.find | def find(self, sub, start=None, end=None):
"""Return the lowest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginni... | python | def find(self, sub, start=None, end=None):
"""Return the lowest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginni... | Return the lowest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison a... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L171-L180 |
Robpol86/colorclass | colorclass/core.py | ColorStr.format | def format(self, *args, **kwargs):
"""Return a formatted version, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
"""
return self.__class__(super(ColorStr, self).format(*args, **kwargs), keep_tags=True) | python | def format(self, *args, **kwargs):
"""Return a formatted version, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}').
"""
return self.__class__(super(ColorStr, self).format(*args, **kwargs), keep_tags=True) | Return a formatted version, using substitutions from args and kwargs.
The substitutions are identified by braces ('{' and '}'). | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L182-L187 |
Robpol86/colorclass | colorclass/core.py | ColorStr.index | def index(self, sub, start=None, end=None):
"""Like S.find() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position.
"""
return self.value_no_colors... | python | def index(self, sub, start=None, end=None):
"""Like S.find() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position.
"""
return self.value_no_colors... | Like S.find() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L189-L196 |
Robpol86/colorclass | colorclass/core.py | ColorStr.join | def join(self, iterable):
"""Return a string which is the concatenation of the strings in the iterable.
:param iterable: Join items in this iterable.
"""
return self.__class__(super(ColorStr, self).join(iterable), keep_tags=True) | python | def join(self, iterable):
"""Return a string which is the concatenation of the strings in the iterable.
:param iterable: Join items in this iterable.
"""
return self.__class__(super(ColorStr, self).join(iterable), keep_tags=True) | Return a string which is the concatenation of the strings in the iterable.
:param iterable: Join items in this iterable. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L234-L239 |
Robpol86/colorclass | colorclass/core.py | ColorStr.rfind | def rfind(self, sub, start=None, end=None):
"""Return the highest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Begin... | python | def rfind(self, sub, start=None, end=None):
"""Return the highest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Begin... | Return the highest index where substring sub is found, such that sub is contained within string[start:end].
Optional arguments start and end are interpreted as in slice notation.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison ... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L253-L262 |
Robpol86/colorclass | colorclass/core.py | ColorStr.rindex | def rindex(self, sub, start=None, end=None):
"""Like .rfind() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position.
"""
return self.value_no_color... | python | def rindex(self, sub, start=None, end=None):
"""Like .rfind() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position.
"""
return self.value_no_color... | Like .rfind() but raise ValueError when the substring is not found.
:param str sub: Substring to search.
:param int start: Beginning position.
:param int end: Stop comparison at this position. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L264-L271 |
Robpol86/colorclass | colorclass/core.py | ColorStr.splitlines | def splitlines(self, keepends=False):
"""Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and True.
:param bool keepends: Include linebreaks.
"""
return [self.__class__(l) for l in... | python | def splitlines(self, keepends=False):
"""Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and True.
:param bool keepends: Include linebreaks.
"""
return [self.__class__(l) for l in... | Return a list of the lines in the string, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends is given and True.
:param bool keepends: Include linebreaks. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L285-L292 |
Robpol86/colorclass | colorclass/core.py | ColorStr.startswith | def startswith(self, prefix, start=0, end=-1):
"""Return True if string starts with the specified prefix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position. prefix
can also be a tuple of strings to try.
:param str ... | python | def startswith(self, prefix, start=0, end=-1):
"""Return True if string starts with the specified prefix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position. prefix
can also be a tuple of strings to try.
:param str ... | Return True if string starts with the specified prefix, False otherwise.
With optional start, test beginning at that position. With optional end, stop comparing at that position. prefix
can also be a tuple of strings to try.
:param str prefix: Prefix to search.
:param int start: Beginn... | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L294-L304 |
Robpol86/colorclass | colorclass/core.py | ColorStr.zfill | def zfill(self, width):
"""Pad a numeric string with zeros on the left, to fill a field of the specified width.
The string is never truncated.
:param int width: Length of output string.
"""
if not self.value_no_colors:
result = self.value_no_colors.zfill(width)
... | python | def zfill(self, width):
"""Pad a numeric string with zeros on the left, to fill a field of the specified width.
The string is never truncated.
:param int width: Length of output string.
"""
if not self.value_no_colors:
result = self.value_no_colors.zfill(width)
... | Pad a numeric string with zeros on the left, to fill a field of the specified width.
The string is never truncated.
:param int width: Length of output string. | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/core.py#L331-L342 |
Robpol86/colorclass | colorclass/color.py | Color.colorize | def colorize(cls, color, string, auto=False):
"""Color-code entire string using specified color.
:param str color: Color of string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
... | python | def colorize(cls, color, string, auto=False):
"""Color-code entire string using specified color.
:param str color: Color of string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
... | Color-code entire string using specified color.
:param str color: Color of string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L17-L28 |
Robpol86/colorclass | colorclass/color.py | Color.black | def black(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('black', string... | python | def black(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('black', string... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L31-L40 |
Robpol86/colorclass | colorclass/color.py | Color.bgblack | def bgblack(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgblack', st... | python | def bgblack(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgblack', st... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L43-L52 |
Robpol86/colorclass | colorclass/color.py | Color.red | def red(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('red', string, au... | python | def red(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('red', string, au... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L55-L64 |
Robpol86/colorclass | colorclass/color.py | Color.bgred | def bgred(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgred', string... | python | def bgred(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgred', string... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L67-L76 |
Robpol86/colorclass | colorclass/color.py | Color.green | def green(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('green', string... | python | def green(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('green', string... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L79-L88 |
Robpol86/colorclass | colorclass/color.py | Color.bggreen | def bggreen(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bggreen', st... | python | def bggreen(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bggreen', st... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L91-L100 |
Robpol86/colorclass | colorclass/color.py | Color.yellow | def yellow(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('yellow', stri... | python | def yellow(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('yellow', stri... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L103-L112 |
Robpol86/colorclass | colorclass/color.py | Color.bgyellow | def bgyellow(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgyellow', ... | python | def bgyellow(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('bgyellow', ... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L115-L124 |
Robpol86/colorclass | colorclass/color.py | Color.blue | def blue(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('blue', string, ... | python | def blue(cls, string, auto=False):
"""Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color
"""
return cls.colorize('blue', string, ... | Color-code entire string.
:param str string: String to colorize.
:param bool auto: Enable auto-color (dark/light terminal).
:return: Class instance for colorized string.
:rtype: Color | https://github.com/Robpol86/colorclass/blob/692e2d6f5ad470b6221c8cb9641970dc5563a572/colorclass/color.py#L127-L136 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.