changeset 0df486b9e2db in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=0df486b9e2db
description:
Distinct function from method in documentation
issue11408
diffstat:
doc/ref/bus.rst | 4 ++--
doc/ref/cache.rst | 24 ++++++++++++------------
doc/ref/filestore.rst | 12 ++++++------
doc/ref/i18n.rst | 4 ++--
doc/ref/models.rst | 6 +++---
doc/ref/sendmail.rst | 6 +++---
doc/ref/tools/email.rst | 2 +-
doc/ref/tools/misc.rst | 18 +++++++++---------
8 files changed, 38 insertions(+), 38 deletions(-)
diffs (271 lines):
diff -r a18d951b647d -r 0df486b9e2db doc/ref/bus.rst
--- a/doc/ref/bus.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/bus.rst Sat Apr 30 22:57:33 2022 +0200
@@ -69,9 +69,9 @@
Notification
------------
-Tryton provides a shortcut to send a notification with the ``notify`` method.
+Tryton provides a shortcut to send a notification with the ``notify`` function.
-.. method:: notify(title[, body[, priority[, user[, client]]]])
+.. function:: notify(title[, body[, priority[, user[, client]]]])
Send a text message to a user's client to be displayed using a notification
popup. The meaning of ``title``, ``body`` and ``priority`` is defined in
diff -r a18d951b647d -r 0df486b9e2db doc/ref/cache.rst
--- a/doc/ref/cache.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/cache.rst Sat Apr 30 22:57:33 2022 +0200
@@ -28,55 +28,55 @@
As there is no deepcopy of the values cached, they must never be mutated
after being set in or retrieved from the cache.
-.. attribute:: hit
+.. attribute:: Cache.hit
Count the number of times the cache returned a cached value.
-.. attribute:: miss
+.. attribute:: Cache.miss
Count the number of times the cache did not contain the key.
-.. classmethod:: stats()
+.. classmethod:: Cache.stats()
Yield statistics for each instance.
-.. method:: get(key[, default])
+.. method:: Cache.get(key[, default])
Retrieve the value of the key in the cache.
If a ``default`` is specified it is returned when the key is missing
otherwise it returns ``None``.
-.. method:: set(key, value)
+.. method:: Cache.set(key, value)
Set the ``value`` of the ``key`` in the cache.
-.. method:: clear()
+.. method:: Cache.clear()
Clear all the keys in the cache.
-.. classmethod:: clear_all()
+.. classmethod:: Cache.clear_all()
Clear all cache instances.
-.. classmethod:: sync(transaction)
+.. classmethod:: Cache.sync(transaction)
Synchronize caches between servers using :class:`transaction
<trytond.transaction.Transaction>` instance.
-.. method:: sync_since(value)
+.. method:: Cache.sync_since(value)
Return ``True`` if the last synchronization was done before ``value``.
-.. classmethod:: commit(transaction)
+.. classmethod:: Cache.commit(transaction)
Apply cache changes from transaction.
-.. classmethod:: rollback(transaction)
+.. classmethod:: Cache.rollback(transaction)
Remove cache changes from transaction.
-.. classmethod:: drop(dbname)
+.. classmethod:: Cache.drop(dbname)
Drop all caches for named database.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/filestore.rst
--- a/doc/ref/filestore.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/filestore.rst Sat Apr 30 22:57:33 2022 +0200
@@ -12,28 +12,28 @@
It uses a two levels of directory composed of the 2 chars of the file hash.
It is an append only storage.
-.. method:: get(id[, prefix])
+.. method:: FileStore.get(id[, prefix])
Retrieve the content of the file referred by the id in the prefixed
directory.
-.. method:: getmany(ids[, prefix])
+.. method:: FileStore.getmany(ids[, prefix])
Retrieve a list of contents for the sequence of ids.
-.. method:: size(id[, prefix])
+.. method:: FileStore.size(id[, prefix])
Return the size of the file referred by the id in the prefixed directory.
-.. method:: sizemany(ids[, prefix])
+.. method:: FileStore.sizemany(ids[, prefix])
Return a list of sizes for the sequence of ids.
-.. method:: set(data[, prefix])
+.. method:: FileStore.set(data[, prefix])
Store the data in the prefixed directory and return the identifiers.
-.. method:: setmany(data[, prefix])
+.. method:: FileStore.setmany(data[, prefix])
Store the sequence of data and return a list of identifiers.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/i18n.rst
--- a/doc/ref/i18n.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/i18n.rst Sat Apr 30 22:57:33 2022 +0200
@@ -4,7 +4,7 @@
Internationalization
====================
-.. method:: gettext(message_id, [language[, \**variables]])
+.. function:: gettext(message_id, [language[, \**variables]])
Return the message translated into the ``language``.
@@ -14,7 +14,7 @@
If ``language`` is not set, then the :attr:`Transaction.language
<trytond.transaction.Transaction.language>` is used.
-.. method:: lazy_gettext(message_id, [language[, \**variables]])
+.. function:: lazy_gettext(message_id, [language[, \**variables]])
Return a LazyString that will be translated with gettext later when actually
used.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/models.rst
--- a/doc/ref/models.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/models.rst Sat Apr 30 22:57:33 2022 +0200
@@ -904,7 +904,7 @@
sequence_ordered
================
-.. method:: sequence_ordered([field_name, [field_label, [order]]])
+.. function:: sequence_ordered([field_name, [field_label, [order]]])
Return a mixin_ class which defines the order of a :class:`ModelSQL` with an
:class:`~fields.Integer` field.
@@ -995,7 +995,7 @@
tree
====
-.. method:: tree([parent[, name[, separator]]])
+.. function:: tree([parent[, name[, separator]]])
Return a mixin_ class :class:`TreeMixin`.
@@ -1018,7 +1018,7 @@
avatar_mixin
============
-.. method:: avatar_mixin([size[, default]])
+.. function:: avatar_mixin([size[, default]])
Return a mixin_ :class:`AvatarMixin`.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/sendmail.rst
--- a/doc/ref/sendmail.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/sendmail.rst Sat Apr 30 22:57:33 2022 +0200
@@ -4,7 +4,7 @@
Sendmail
========
-.. method:: sendmail_transactional(from_addr, to_addrs, msg[, transaction[,
datamanager[, strict]]])
+.. function:: sendmail_transactional(from_addr, to_addrs, msg[, transaction[,
datamanager[, strict]]])
Send email message only if the current transaction is successfully
committed.
@@ -21,7 +21,7 @@
An SMTP failure is only logged without raising any exception.
-.. method:: sendmail(from_addr, to_addrs, msg[, server[, strict]])
+.. function:: sendmail(from_addr, to_addrs, msg[, server[, strict]])
Send email message like :meth:`sendmail_transactional` but directly without
caring about the transaction and return the ``server``.
@@ -32,7 +32,7 @@
If strict is ``True``, an exception is raised if it is not possible to
connect to the server.
-.. method:: get_smtp_server([uri[, strict]])
+.. function:: get_smtp_server([uri[, strict]])
Return a SMTP instance from `smtplib`_ using the ``uri`` or the one defined
in the ``email`` section of the :ref:`configuration <topics-configuration>`.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/tools/email.rst
--- a/doc/ref/tools/email.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/tools/email.rst Sat Apr 30 22:57:33 2022 +0200
@@ -4,6 +4,6 @@
Email
=====
-.. method:: set_from_header(message, sender, from\_)
+.. function:: set_from_header(message, sender, from\_)
Fill email headers to appear at best from the address.
diff -r a18d951b647d -r 0df486b9e2db doc/ref/tools/misc.rst
--- a/doc/ref/tools/misc.rst Fri Apr 29 17:14:27 2022 +0200
+++ b/doc/ref/tools/misc.rst Sat Apr 30 22:57:33 2022 +0200
@@ -4,42 +4,42 @@
Miscellaneous
=============
-.. method:: file_open(name[, mode[, subdir[, encoding]]])
+.. function:: file_open(name[, mode[, subdir[, encoding]]])
Open the named file in subdir from the root directory.
-.. method:: find_path(name[, subdir])
+.. function:: find_path(name[, subdir])
Return the path of the named file in subdir from root directory.
-.. method:: find_dir(name[, subdir])
+.. function:: find_dir(name[, subdir])
Return the path of the named directory in subdir from root directory.
-.. method:: resolve(name)
+.. function:: resolve(name)
Resolve a dotted name to a global object.
-.. method:: unescape_wildcard(string[, wildcards[, escape]])
+.. function:: unescape_wildcard(string[, wildcards[, escape]])
Return the string without the wild card escapes.
-.. method:: is_full_text(value[, escape])
+.. function:: is_full_text(value[, escape])
Determine if the value can be used as full text search.
This is the case when the value starts and ends with a ``%`` or does not
contain any wild cards.
-.. method:: sql_pairing(x, y)
+.. function:: sql_pairing(x, y)
Return an SQL expression that pairs SQL integers x and y.
-.. method:: firstline(text)
+.. function:: firstline(text)
Return first non-empty line of a text field.
-.. method:: remove_forbidden_chars(value)
+.. function:: remove_forbidden_chars(value)
Return a copy of the string with forbidden char from
:class:`~trytond.model.fields.Char` replaced by space.