# SOME DESCRIPTIVE TITLE. # Copyright (C) 2001-2016, Python Software Foundation # This file is distributed under the same license as the Python package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Python 3.6\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-10 00:49+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../Doc/library/shelve.rst:2 msgid ":mod:`shelve` --- Python object persistence" msgstr "" #: ../Doc/library/shelve.rst:7 msgid "**Source code:** :source:`Lib/shelve.py`" msgstr "**Code source :** :source:`Lib/shelve.py`" #: ../Doc/library/shelve.rst:13 msgid "" "A \"shelf\" is a persistent, dictionary-like object. The difference with " "\"dbm\" databases is that the values (not the keys!) in a shelf can be " "essentially arbitrary Python objects --- anything that the :mod:`pickle` " "module can handle. This includes most class instances, recursive data types, " "and objects containing lots of shared sub-objects. The keys are ordinary " "strings." msgstr "" #: ../Doc/library/shelve.rst:22 msgid "" "Open a persistent dictionary. The filename specified is the base filename " "for the underlying database. As a side-effect, an extension may be added to " "the filename and more than one file may be created. By default, the " "underlying database file is opened for reading and writing. The optional " "*flag* parameter has the same interpretation as the *flag* parameter of :" "func:`dbm.open`." msgstr "" #: ../Doc/library/shelve.rst:28 msgid "" "By default, version 3 pickles are used to serialize values. The version of " "the pickle protocol can be specified with the *protocol* parameter." msgstr "" #: ../Doc/library/shelve.rst:31 msgid "" "Because of Python semantics, a shelf cannot know when a mutable persistent-" "dictionary entry is modified. By default modified objects are written " "*only* when assigned to the shelf (see :ref:`shelve-example`). If the " "optional *writeback* parameter is set to ``True``, all entries accessed are " "also cached in memory, and written back on :meth:`~Shelf.sync` and :meth:" "`~Shelf.close`; this can make it handier to mutate mutable entries in the " "persistent dictionary, but, if many entries are accessed, it can consume " "vast amounts of memory for the cache, and it can make the close operation " "very slow since all accessed entries are written back (there is no way to " "determine which accessed entries are mutable, nor which ones were actually " "mutated)." msgstr "" #: ../Doc/library/shelve.rst:45 msgid "" "Do not rely on the shelf being closed automatically; always call :meth:" "`~Shelf.close` explicitly when you don't need it any more, or use :func:" "`shelve.open` as a context manager::" msgstr "" #: ../Doc/library/shelve.rst:54 msgid "" "Because the :mod:`shelve` module is backed by :mod:`pickle`, it is insecure " "to load a shelf from an untrusted source. Like with pickle, loading a shelf " "can execute arbitrary code." msgstr "" #: ../Doc/library/shelve.rst:58 msgid "" "Shelf objects support all methods supported by dictionaries. This eases the " "transition from dictionary based scripts to those requiring persistent " "storage." msgstr "" #: ../Doc/library/shelve.rst:61 msgid "Two additional methods are supported:" msgstr "" #: ../Doc/library/shelve.rst:65 msgid "" "Write back all entries in the cache if the shelf was opened with *writeback* " "set to :const:`True`. Also empty the cache and synchronize the persistent " "dictionary on disk, if feasible. This is called automatically when the " "shelf is closed with :meth:`close`." msgstr "" #: ../Doc/library/shelve.rst:72 msgid "" "Synchronize and close the persistent *dict* object. Operations on a closed " "shelf will fail with a :exc:`ValueError`." msgstr "" #: ../Doc/library/shelve.rst:78 msgid "" "`Persistent dictionary recipe `_ with widely supported storage formats and having the speed of native " "dictionaries." msgstr "" #: ../Doc/library/shelve.rst:84 msgid "Restrictions" msgstr "" #: ../Doc/library/shelve.rst:90 msgid "" "The choice of which database package will be used (such as :mod:`dbm.ndbm` " "or :mod:`dbm.gnu`) depends on which interface is available. Therefore it is " "not safe to open the database directly using :mod:`dbm`. The database is " "also (unfortunately) subject to the limitations of :mod:`dbm`, if it is used " "--- this means that (the pickled representation of) the objects stored in " "the database should be fairly small, and in rare cases key collisions may " "cause the database to refuse updates." msgstr "" #: ../Doc/library/shelve.rst:98 msgid "" "The :mod:`shelve` module does not support *concurrent* read/write access to " "shelved objects. (Multiple simultaneous read accesses are safe.) When a " "program has a shelf open for writing, no other program should have it open " "for reading or writing. Unix file locking can be used to solve this, but " "this differs across Unix versions and requires knowledge about the database " "implementation used." msgstr "" #: ../Doc/library/shelve.rst:108 msgid "" "A subclass of :class:`collections.abc.MutableMapping` which stores pickled " "values in the *dict* object." msgstr "" #: ../Doc/library/shelve.rst:111 msgid "" "By default, version 3 pickles are used to serialize values. The version of " "the pickle protocol can be specified with the *protocol* parameter. See the :" "mod:`pickle` documentation for a discussion of the pickle protocols." msgstr "" #: ../Doc/library/shelve.rst:115 msgid "" "If the *writeback* parameter is ``True``, the object will hold a cache of " "all entries accessed and write them back to the *dict* at sync and close " "times. This allows natural operations on mutable entries, but can consume " "much more memory and make sync and close take a long time." msgstr "" #: ../Doc/library/shelve.rst:120 msgid "" "The *keyencoding* parameter is the encoding used to encode keys before they " "are used with the underlying dict." msgstr "" #: ../Doc/library/shelve.rst:123 msgid "" "A :class:`Shelf` object can also be used as a context manager, in which case " "it will be automatically closed when the :keyword:`with` block ends." msgstr "" #: ../Doc/library/shelve.rst:126 msgid "" "Added the *keyencoding* parameter; previously, keys were always encoded in " "UTF-8." msgstr "" #: ../Doc/library/shelve.rst:130 msgid "Added context manager support." msgstr "Ajout du support des gestionnaires de contexte." #: ../Doc/library/shelve.rst:136 msgid "" "A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`, :" "meth:`previous`, :meth:`last` and :meth:`set_location` which are available " "in the third-party :mod:`bsddb` module from `pybsddb `_ but not in other database modules. The *dict* " "object passed to the constructor must support those methods. This is " "generally accomplished by calling one of :func:`bsddb.hashopen`, :func:" "`bsddb.btopen` or :func:`bsddb.rnopen`. The optional *protocol*, " "*writeback*, and *keyencoding* parameters have the same interpretation as " "for the :class:`Shelf` class." msgstr "" #: ../Doc/library/shelve.rst:149 msgid "" "A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-" "like object. The underlying file will be opened using :func:`dbm.open`. By " "default, the file will be created and opened for both read and write. The " "optional *flag* parameter has the same interpretation as for the :func:`." "open` function. The optional *protocol* and *writeback* parameters have the " "same interpretation as for the :class:`Shelf` class." msgstr "" #: ../Doc/library/shelve.rst:160 msgid "Example" msgstr "Exemple" #: ../Doc/library/shelve.rst:162 msgid "" "To summarize the interface (``key`` is a string, ``data`` is an arbitrary " "object)::" msgstr "" #: ../Doc/library/shelve.rst:199 msgid "Module :mod:`dbm`" msgstr "" #: ../Doc/library/shelve.rst:199 msgid "Generic interface to ``dbm``-style databases." msgstr "" #: ../Doc/library/shelve.rst:201 msgid "Module :mod:`pickle`" msgstr "" #: ../Doc/library/shelve.rst:202 msgid "Object serialization used by :mod:`shelve`." msgstr ""