1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
|
:mod:`trac.util` -- General purpose utilities
=============================================
.. module :: trac.util
The `trac.util` package is a hodgepodge of various categories of
utilities. If a category contains enough code in itself, it earns a
sub-module on its own, like the following ones:
.. toctree::
:maxdepth: 1
:glob:
trac_util_*
Otherwise, the functions are direct members of the `trac.util` package
(i.e. placed in the "__init__.py" file).
Web related utilities
---------------------
.. autofunction :: trac.util.get_reporter_id
.. autofunction :: trac.util.content_disposition
OS related utilities
--------------------
.. autofunction :: copytree
.. autofunction :: create_file
.. autofunction :: create_unique_file
.. autofunction :: getuser
.. autofunction :: is_path_below
.. autofunction :: makedirs
.. autofunction :: native_path
.. autofunction :: read_file
.. autofunction :: rename
.. autofunction :: terminate
.. autofunction :: touch_file
.. autoclass :: AtomicFile
:members:
.. autoclass :: NaivePopen
:members:
.. autoexception :: WindowsError
Also defined on non-Windows systems (by a dummy OSError subclass).
.. autoclass :: file_or_std
.. data :: urandom
The standard `os.urandom` when available, otherwise a reasonable
replacement.
Python "system" utilities
-------------------------
Complements the `inspect`, `traceback` and `sys` modules.
.. autofunction :: fq_class_name
.. autofunction :: arity
.. autofunction :: get_last_traceback
.. autofunction :: get_lines_from_file
.. autofunction :: get_frame_info
.. autofunction :: import_namespace
.. autofunction :: safe__import__
.. autofunction :: safe_repr
.. autofunction :: get_doc
Setuptools utilities
--------------------
.. autofunction :: get_module_path
.. autofunction :: get_sources
.. autofunction :: get_pkginfo
Cryptographic related utilities
-------------------------------
.. autofunction :: hex_entropy
.. autofunction :: md5crypt
.. autofunction :: salt
Data structures which don't fit anywhere else
---------------------------------------------
.. autoclass :: Ranges
:members:
.. autofunction :: create_zipinfo
.. autofunction :: to_ranges
.. autofunction :: to_list
.. autoclass :: lazy
Algorithmic utilities
---------------------
.. autofunction :: embedded_numbers
.. autofunction :: partition
.. autofunction :: as_int
.. autofunction :: as_bool
.. autofunction :: pathjoin
.. autofunction :: sub_val
|