|
Drake
|
For more high-level information, see the Python Bindings technical notes.
Drake developers should prefer any aliases defined here over their full spellings in pybind11
.
namespace py
is a shorthand alias to pybind11
for consistency. (This symbol cannot be exposed directly in Doxygen.)
using namespace drake::pydrake
, as this may create ambiguous aliases (especially for GCC). Instead, consider using your own alias directly to the pybind11
namespace. Namespaces | |
| pysolvers | |
| pysystems | |
Classes | |
| class | Object |
Provides a publicly visible, but minimal, re-implementation of py::object so that a public type can be used with drake::Value<T> , while still maintaining the revelant semantics with its generic implementation (#13207). More... | |
| struct | overload_cast_impl |
| struct | wrap_arg_default |
| Default case for argument wrapping, with pure pass-through. More... | |
Typedefs | |
| using | CommonScalarPack = type_pack< double, AutoDiffXd, symbolic::Expression > |
| Type pack defining common scalar types. More... | |
| using | NonSymbolicScalarPack = type_pack< double, AutoDiffXd > |
| Type pack for non-symbolic common scalar types. More... | |
| template<template< typename... > class wrap_arg_policy, typename Signature > | |
| using | wrap_arg_function = typename internal::wrap_function_impl< wrap_arg_policy >::template wrap_arg< std::function< Signature > > |
| Policy for explicitly wrapping functions for a given policy. More... | |
| using | py_rvp = py::return_value_policy |
| Shortened alias for py::return_value_policy. More... | |
Functions | |
| template<typename... Ts> | |
| py::tuple | GetPyParam (type_pack< Ts... >={}) |
| Gets the canonical Python parameters for each C++ type. More... | |
| template<typename T > | |
| std::string | TemporaryClassName (const std::string &name="TemporaryName") |
Provides a temporary, unique name for a class instantiation that will be passed to AddTemplateClass . More... | |
| py::object | AddTemplateClass (py::handle scope, const std::string &name, py::handle py_class, py::tuple param) |
| Adds a template class instantiation. More... | |
| template<typename Class , typename... Options> | |
| py::class_< Class, Options... > | DefineTemplateClassWithDefault (py::handle scope, const std::string &default_name, py::tuple param, const char *doc_string="", const std::string &template_suffix="_") |
| Provides a convenience wrapper for defining a template class instantiation and a default instantiation (if not already defined). More... | |
| template<typename Func , typename... Extra> | |
| py::object | AddTemplateFunction (py::handle scope, const std::string &name, Func &&func, py::tuple param, Extra &&... extra) |
| Declares a template function. More... | |
| template<typename Method , typename... Extra> | |
| py::object | AddTemplateMethod (py::handle scope, const std::string &name, Method &&method, py::tuple param, Extra &&... extra) |
| Declares a template method. More... | |
| template<typename T > | |
| py::return_value_policy | return_value_policy_for_scalar_type () |
| Permits referencing for builtin dtypes (e.g. More... | |
| template<typename T , typename PyClass , typename UPack = typename internal::CastUPack<T>::Pack> | |
| void | DefCast (PyClass *cls, const char *doc, UPack U_pack={}) |
Binds cast<T>() explicitly. More... | |
| void | DeprecateAttribute (py::object cls, py::str name, py::str message, std::optional< std::string > date={}) |
Deprecates an attribute name of a class cls . More... | |
| void | WarnDeprecated (py::str message, std::optional< std::string > date={}) |
| Raises a deprecation warning. More... | |
| template<typename Func > | |
| auto | WrapDeprecated (py::str message, Func &&func) |
| Wraps any callable (function pointer, method pointer, lambda, etc.) to emit a deprecation message. More... | |
| template<typename Class , typename... Args> | |
| auto | py_init_deprecated (py::str message) |
Deprecated wrapping of py::init<> . More... | |
| template<typename Func > | |
| auto | py_init_deprecated (py::str message, Func &&func) |
Deprecated wrapping of py::init(factory) . More... | |
| template<typename Derived > | |
| auto | ToEigenRef (Eigen::VectorBlock< Derived > *derived) |
| Provides a mutable Ref<> for a pointer. More... | |
| template<typename T > | |
| py::object | ToArray (T *ptr, int size, py::tuple shape) |
| Converts a raw array to a numpy array. More... | |
| template<typename T > | |
| py::object | ToArray (const T *ptr, int size, py::tuple shape) |
Converts a raw array to a numpy array (const variant). More... | |
| template<typename Class > | |
| auto | BindTypeSafeIndex (py::module m, const std::string &name, const std::string &class_doc="") |
| Binds a TypeSafeIndex instantiation. More... | |
| template<typename T , typename Class = drake::Value<T>> | |
| py::class_< Class, drake::AbstractValue > | AddValueInstantiation (py::module scope) |
Defines an instantiation of pydrake.common.value.Value[...] . More... | |
| template<template< typename... > class wrap_arg_policy, bool use_functions = true, typename Func = void> | |
| auto | WrapFunction (Func &&func) |
| Wraps the types used in a function signature to produce a new function with wrapped arguments and return value (if non-void). More... | |
| template<typename Func > | |
| auto | WrapCallbacks (Func &&func) |
Ensures that any std::function<> arguments are wrapped such that any T& (which can infer for T = const U ) is wrapped as U* (and conversely unwrapped when returned). More... | |
| template<typename PyClass , typename Class , typename T > | |
| void | DefReadWriteKeepAlive (PyClass *cls, const char *name, T Class::*member, const char *doc="") |
Idempotent to pybind11's def_readwrite() , with the exception that the setter is protected with keep_alive on a member variable that is a bare pointer. More... | |
| template<typename PyClass , typename Class , typename T > | |
| void | DefReadUniquePtr (PyClass *cls, const char *name, const std::unique_ptr< T > Class::*member, const char *doc="") |
Idempotent to pybind11's def_readonly() , which works for unique_ptr elements; the getter is protected with keep_alive on a member variable that is a unique_ptr. More... | |
| template<typename PyClass , typename Class , typename T > | |
| void | DefReadUniquePtr (PyClass *cls, const char *name, const copyable_unique_ptr< T > Class::*member, const char *doc="") |
| py::object | py_keep_alive (py::object nurse, py::object patient) |
| Use this when you must do manual casting - e.g. More... | |
| template<typename PyClass > | |
| void | DefCopyAndDeepCopy (PyClass *ppy_class) |
Binds Pythonic __copy__ and __deepcopy__ using class's copy constructor. More... | |
| template<typename PyClass > | |
| void | DefClone (PyClass *ppy_class) |
Binds Pythonic __copy__ and __deepcopy__ for a class, as well as Clone method, using class's Clone method rather than the copy constructor. More... | |
| template<typename Class > | |
| auto | ParamInit () |
Returns a constructor for creating an instance of Class and initializing parameters (bound using def_readwrite ). More... | |
| void | ExecuteExtraPythonCode (py::module m) |
| Executes Python code to introduce additional symbols for a given module. More... | |
| void | DefineFrameworkPySemantics (py::module m) |
| void | DefineFrameworkPySystems (py::module m) |
| void | DefineFrameworkPyValues (py::module m) |
Variables | |
| const auto | py_reference = py::return_value_policy::reference |
Used when returning T& or const T&`, as pybind's default behavior is to copy lvalue references. More... | |
| const auto | py_reference_internal = py::return_value_policy::reference_internal |
Used when returning references to objects that are internally owned by self . More... | |
| template<typename Return , typename... Args> | |
| constexpr auto | overload_cast_explicit = overload_cast_impl<Return, Args...>{} |
Provides option to provide explicit signature when py::overload_cast<Args...> fails to infer the Return argument. More... | |
| using CommonScalarPack = type_pack< double, AutoDiffXd, symbolic::Expression> |
Type pack defining common scalar types.
| using NonSymbolicScalarPack = type_pack< double, AutoDiffXd> |
Type pack for non-symbolic common scalar types.
| using py_rvp = py::return_value_policy |
Shortened alias for py::return_value_policy.
For more information, see the Return Value Policy section.
| using wrap_arg_function = typename internal::wrap_function_impl< wrap_arg_policy>::template wrap_arg<std::function<Signature> > |
Policy for explicitly wrapping functions for a given policy.
| py::object drake::pydrake::AddTemplateClass | ( | py::handle | scope, |
| const std::string & | name, | ||
| py::handle | py_class, | ||
| py::tuple | param | ||
| ) |
Adds a template class instantiation.
| scope | Parent scope of the template. |
| name | Name of the template. |
| py_class | Class instantiation to be added. |
py::class_<Class, ...>(m, TemporaryClassName<Class>().c_str())
. | param | Parameters for the instantiation. |
| py::object drake::pydrake::AddTemplateFunction | ( | py::handle | scope, |
| const std::string & | name, | ||
| Func && | func, | ||
| py::tuple | param, | ||
| Extra &&... | extra | ||
| ) |
Declares a template function.
| scope | Parent scope of the template. |
| name | Name of the template. |
| func | Function to be added. |
| param | Parameters for the instantiation. |
| extra... | Additional arguments to pass to py::cpp_function . |
| py::object drake::pydrake::AddTemplateMethod | ( | py::handle | scope, |
| const std::string & | name, | ||
| Method && | method, | ||
| py::tuple | param, | ||
| Extra &&... | extra | ||
| ) |
Declares a template method.
| scope | Parent scope of the template. This should be a class. |
| name | Name of the template. |
| method | Method to be added. |
| param | Parameters for the instantiation. |
| extra... | Additional arguments to pass to py::cpp_function . |
| py::class_<Class, drake::AbstractValue> drake::pydrake::AddValueInstantiation | ( | py::module | scope | ) |
Defines an instantiation of pydrake.common.value.Value[...]
.
This is only meant to bind Value<T>
(or specializations thereof). @prereq T
must have already been exposed to pybind11
.
| scope | Parent scope. |
| T | Inner parameter of Value<T> . |
| Class | Class to be bound. By default, Value<T> is used. |
| auto drake::pydrake::BindTypeSafeIndex | ( | py::module | m, |
| const std::string & | name, | ||
| const std::string & | class_doc = "" |
||
| ) |
Binds a TypeSafeIndex instantiation.
| void drake::pydrake::DefCast | ( | PyClass * | cls, |
| const char * | doc, | ||
| UPack | U_pack = {} |
||
| ) |
Binds cast<T>()
explicitly.
| void drake::pydrake::DefClone | ( | PyClass * | ppy_class | ) |
Binds Pythonic __copy__
and __deepcopy__
for a class, as well as Clone
method, using class's Clone
method rather than the copy constructor.
| void drake::pydrake::DefCopyAndDeepCopy | ( | PyClass * | ppy_class | ) |
Binds Pythonic __copy__
and __deepcopy__
using class's copy constructor.
| void drake::pydrake::DefineFrameworkPySemantics | ( | py::module | m | ) |
| void drake::pydrake::DefineFrameworkPySystems | ( | py::module | m | ) |
| void drake::pydrake::DefineFrameworkPyValues | ( | py::module | m | ) |
| py::class_<Class, Options...> drake::pydrake::DefineTemplateClassWithDefault | ( | py::handle | scope, |
| const std::string & | default_name, | ||
| py::tuple | param, | ||
| const char * | doc_string = "" , |
||
| const std::string & | template_suffix = "_" |
||
| ) |
Provides a convenience wrapper for defining a template class instantiation and a default instantiation (if not already defined).
The default instantiation is named default_name
, while the template is named default_name + template_suffix
.
| void drake::pydrake::DefReadUniquePtr | ( | PyClass * | cls, |
| const char * | name, | ||
| const std::unique_ptr< T > Class::* | member, | ||
| const char * | doc = "" |
||
| ) |
Idempotent to pybind11's def_readonly()
, which works for unique_ptr elements; the getter is protected with keep_alive on a member
variable that is a unique_ptr.
| PyClass | the python class. |
| Class | the C++ class. |
| T | type for the member we wish to apply keep alive semantics. |
| void drake::pydrake::DefReadUniquePtr | ( | PyClass * | cls, |
| const char * | name, | ||
| const copyable_unique_ptr< T > Class::* | member, | ||
| const char * | doc = "" |
||
| ) |
| void drake::pydrake::DefReadWriteKeepAlive | ( | PyClass * | cls, |
| const char * | name, | ||
| T Class::* | member, | ||
| const char * | doc = "" |
||
| ) |
Idempotent to pybind11's def_readwrite()
, with the exception that the setter is protected with keep_alive on a member
variable that is a bare pointer.
Should not be used for unique_ptr members.
| PyClass | the python class. |
| Class | the C++ class. |
| T | type for the member we wish to apply keep alive semantics. |
| void drake::pydrake::DeprecateAttribute | ( | py::object | cls, |
| py::str | name, | ||
| py::str | message, | ||
| std::optional< std::string > | date = {} |
||
| ) |
Deprecates an attribute name
of a class cls
.
This only works with class attributes (unbound members or methods) as it is implemented with a Python property descriptor.
| void drake::pydrake::ExecuteExtraPythonCode | ( | py::module | m | ) |
Executes Python code to introduce additional symbols for a given module.
For a module with local name {name}
, the code executed will be _{name}_extra.py
. See #9599 for relevant background.
| py::tuple drake::pydrake::GetPyParam | ( | type_pack< Ts... > | = {} | ) |
Gets the canonical Python parameters for each C++ type.
| std::runtime_error | on the first type it encounters that is neither aliased nor registered in pybind11 . |
| Ts | The types to get C++ types for. |
py::
symbol (e.g. py::object
). On Mac, this may cause failure depending on import order (e.g. trying to use Value<py::object>
between different modules). See #8704 and #13207 for more details. | auto drake::pydrake::ParamInit | ( | ) |
Returns a constructor for creating an instance of Class and initializing parameters (bound using def_readwrite
).
This provides an alternative to manually enumerating each parameter as an argument using py::init<...>
and py::arg(...)
, and is useful when the C++ class only has a default constructor. Example:
| Class | The C++ class. Must have a default constructor. |
| auto drake::pydrake::py_init_deprecated | ( | py::str | message | ) |
Deprecated wrapping of py::init<>
.
unique_ptr
holders. If using shared_ptr
, talk to Eric. | auto drake::pydrake::py_init_deprecated | ( | py::str | message, |
| Func && | func | ||
| ) |
Deprecated wrapping of py::init(factory)
.
| py::object drake::pydrake::py_keep_alive | ( | py::object | nurse, |
| py::object | patient | ||
| ) |
Use this when you must do manual casting - e.g.
lists or tuples of nurses, where the container may get discarded but the items kept. Prefer this over py::cast(obj, reference_internal, parent)
(pending full resolution of #11046).
| py::return_value_policy drake::pydrake::return_value_policy_for_scalar_type | ( | ) |
Permits referencing for builtin dtypes (e.g.
T = double), but then switches to copying for custom dtypes (T = {AutoDiffXd, Expression}).
| std::string drake::pydrake::TemporaryClassName | ( | const std::string & | name = "TemporaryName" | ) |
Provides a temporary, unique name for a class instantiation that will be passed to AddTemplateClass
.
| py::object drake::pydrake::ToArray | ( | T * | ptr, |
| int | size, | ||
| py::tuple | shape | ||
| ) |
Converts a raw array to a numpy array.
| py::object drake::pydrake::ToArray | ( | const T * | ptr, |
| int | size, | ||
| py::tuple | shape | ||
| ) |
Converts a raw array to a numpy array (const
variant).
| auto drake::pydrake::ToEigenRef | ( | Eigen::VectorBlock< Derived > * | derived | ) |
Provides a mutable Ref<> for a pointer.
Meant to be used for decorating methods passed to pybind11
(e.g. virtual function dispatch).
| void drake::pydrake::WarnDeprecated | ( | py::str | message, |
| std::optional< std::string > | date = {} |
||
| ) |
Raises a deprecation warning.
DeprecateAttribute
so that the warning is issued immediately when accessed, not only when it is called. | auto drake::pydrake::WrapCallbacks | ( | Func && | func | ) |
Ensures that any std::function<>
arguments are wrapped such that any T&
(which can infer for T = const U
) is wrapped as U*
(and conversely unwrapped when returned).
Use this when you have a callback in C++ that has a lvalue reference (const or mutable) to a C++ argument or return value. Otherwise, pybind11
may try and copy the object, will be bad if either the type is a non-copyable or if you are trying to mutate the object; in this case, the copy is mutated, but not the original you care about. For more information, see: https://github.com/pybind/pybind11/issues/1241
| auto drake::pydrake::WrapDeprecated | ( | py::str | message, |
| Func && | func | ||
| ) |
Wraps any callable (function pointer, method pointer, lambda, etc.) to emit a deprecation message.
| auto drake::pydrake::WrapFunction | ( | Func && | func | ) |
Wraps the types used in a function signature to produce a new function with wrapped arguments and return value (if non-void).
The wrapping is based on wrap_arg_policy
. Any types that are of the form std::function<F>
will be recursively wrapped, such that callbacks will be of a wrapped form (arguments and return types wrapped). The original form of the callbacks will still be called in the wrapped callback.
| wrap_arg_policy | User-supplied argument wrapper, that must supply the static functions wrap(Arg arg) -> Wrapped and unwrap(Wrapped wrapped) -> Arg . Arg arg is the original argument, and Wrapped wrapped is the wrapped / transformed argument type. N.B. This template template parameter uses a parameter pack to allow for SFINAE. If passing a using template alias, ensure that the alias template template parameter uses a parameter pack of the exact same form. |
| use_functions | If true (default), will recursively wrap callbacks. If your policy provides handling for functions, then you should set this to false. |
| func | Functor to be wrapped. Returns a function with wrapped arguments and return type. If functor is a method pointer, it will return a function of the form Return ([const] Class* self, ...) . |
std::function<>
from this if you encounter inference issues downstream of this method. | constexpr auto overload_cast_explicit = overload_cast_impl<Return, Args...>{} |
Provides option to provide explicit signature when py::overload_cast<Args...>
fails to infer the Return argument.
| const auto py_reference = py::return_value_policy::reference |
Used when returning T& or
const T&`, as pybind's default behavior is to copy lvalue references.
(Deprecated.)
| const auto py_reference_internal = py::return_value_policy::reference_internal |
Used when returning references to objects that are internally owned by self
.
Implies both py_rvp::reference
and py::keep_alive<0, 1>
, which implies "Keep alive, reference: `return` keeps` self` alive". (Deprecated.)


Hello! my name is Anit,I am a student at BIRLA INTITUTE of TECHNOLOGY, Mesra.I'm pursuing BTECH in ELCTRONICS AND COMMUNICATIONS ENGINEERING. Currently I am in my FIRST year of my College.
I love learning new skills. I love to read novels or watch Anime in my free time. I try to do my best in both academics and sports.


About
This web application is a part of a software project proposed by IBM GuruKool.
Project Name: Sales Data Tracker_Maintenance-Leave and Delegation
Project Guide:
Hemanth Kumar G<EMAIL_ADDRESS>Dept. of Computer Science,
NMAM Institute of Technology,Nitte.
Group Name: Decryptors
Group Members:
Dharmitha S Shetty<EMAIL_ADDRESS>Laxmikanth Madhyastha<EMAIL_ADDRESS>Manjuprasad Shetty N<EMAIL_ADDRESS>Pallavi A<EMAIL_ADDRESS>Vishwasa Navada K<EMAIL_ADDRESS>Technologies Used: HTML5, CSS3, JavaScript and JQuery for front end design. PHP for server queries. MySQL as Database.
Libraries : JQuery Library and Font Awesome (For Vector icons )


CONFIDENTIAL PROPOSAL FROM
MR , SAHID NGOMA
THE CHIEF AUDITOR INCHARGE,
AFRICAN DEVELOPMENT BANK (ADB).
OUAGADOUGOU BURKINA FASO.
WEST AFRICA.
Dear Partner,
I presumed that all is well with you and your family. Please let this massage do not be a surprise proposal to you because i got your contact information from the international directory in few weeks ago before i decided to contact you on this magnitude and lucrative transaction for our future survival in life. Moreover, i have laid all the solemn trust in you before i decided to disclose this successful & confidential transaction to you.
I AM .
MR SAHID NGOMA
. THE CHIEF AUDITOR INCHARGE OF FOREIGN REMITTANCE UNIT, AFRICAN DEVELOPMENT BANK OUAGADOUDOU BURKINA-FASO.
Now i have the intent to contact you over this financial transaction worth the sum of NINTEEN MILLION, THREE HUNDRED THOUSAND UNITED STATES DOLLARS ($19,300,000.00 ) for our success.This is an abandoned sum that belongs to one of our bank foreign customers who died along with his entire family through plane crash disaster since few years ago. Meanwhile i was very fortune to came across the deceased file when i was arranging the old and abandoned customers files in other to sign and submit to the entire bank management for an official re-documentation and audit of the year against 2007.
Be informed clearly that it was stated in our banking rules and regulations which was signed lawfully that if such fund remains unclaimed till the period of 5 years started from the date when the beneficiary died, the money will be transferred into the treasury as an unclaimed fund. As an honour and advantage bestowed to our foreign customers base on the rules guideing our bank, it was stated obviously that if you are not a Burkina Faso citizen, you have the absolute authority to claim the fund hence you are a foreigner despite your differences from the country of origin of the deceased. So the request of you as a foreigner is necessary to apply for the claim and transfer of the fund smoothly into your reliable bank account as the NEXT OF KIN OR EXTENDED RELATIVE to the deceased.
On the transfer of this fund into your account, { 39% } being ( US$7,527,000.00) will be your share in respect of the account provision and your assistance rendered during the transfer of the fund into your bank account,{ 52% } being (US$10,036,000.00) will be my share being the codinator of the transaction while the rest { 9% } being (US$1,737,000.00) will be shared to the respectable Organisations Centers such as Charity Organisation, Motherless Babies homes, and helpless disabled people in the World.
If you are really sure of your trustworthy, accountability and confidentiality on his transaction, contact me and agree that you will not change your mind to cheat or disappoint me when the fund have getting into your account. Besides you should not entertain any fear because i am sure of the success as an insider in the bank ok.
Please reply with the assurance, include your private telephone and fax numbers necessary for facilitate an easy communication in this transaction. As soon as you reply , call me through my private telephone number (00226 7684 5867) so that i will let you know the next step to follow in order to finalize this transaction immediately.
I expect your urgent communication.Please try to reply with this email.send your number all to me
<EMAIL_ADDRESS>Yours sincerely,
MR SAHID NGOMA
Hotmail to go? Get your Hotmail, news, sports and much more! Check out the New MSN Mobile


| | 1 | = Trac Plugins = |
| | 2 | [[TracGuideToc]] |
| | 3 | |
| | 4 | Since version 0.9, Trac supports plugins that extend the built-in functionality. The plugin functionality is based on the [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture component architecture]. |
| | 5 | |
| | 6 | == Requirements == |
| | 7 | |
| | 8 | To use plugins in Trac, you need to have [http://peak.telecommunity.com/DevCenter/setuptools setuptools] (version 0.6) installed. |
| | 9 | |
| | 10 | To install `setuptools`, download the bootstrap module [http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py] and execute it as follows: |
| | 11 | {{{ |
| | 12 | $ python ez_setup.py |
| | 13 | }}} |
| | 14 | |
| | 15 | If the `ez_setup.py` script fails to install the setuptools release, you can download it from [http://www.python.org/pypi/setuptools PyPI] and install it manually. |
| | 16 | |
| | 17 | == Installing a Trac Plugin == |
| | 18 | |
| | 19 | === For a Single Project === |
| | 20 | |
| | 21 | Plugins are packaged as [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs]. That means they are ZIP archives with the file extension `.egg`. If you have downloaded a source distribution of a plugin, you can run: |
| | 22 | {{{ |
| | 23 | $ python setup.py bdist_egg |
| | 24 | }}} |
| | 25 | to build the `.egg` file. |
| | 26 | |
| | 27 | Once you have the plugin archive, you need to copy it into the `plugins` directory of the [wiki:TracEnvironment project environment]. Also, make sure that the web server has sufficient permissions to read the plugin egg. |
| | 28 | |
| | 29 | === For All Projects === |
| | 30 | |
| | 31 | Plugins that you want to use in all your projects (such as [http://projects.edgewall.com/trac/wiki/WebAdmin WebAdmin]) can be installed globally by running: |
| | 32 | {{{ |
| | 33 | $ python setup.py install |
| | 34 | }}} |
| | 35 | |
| | 36 | Alternatively, you can just drop the `.egg` file in the Python `site-packages` directory. |
| | 37 | |
| | 38 | Unlike plugins installed per-environment, you'll have to explicitly enable globally installed plugins via [wiki:TracIni trac.ini]. This is done in the `[components]` section of the configuration file, for example: |
| | 39 | {{{ |
| | 40 | [components] |
| | 41 | webadmin.* = enabled |
| | 42 | }}} |
| | 43 | |
| | 44 | The name of the option is the Python package of the plugin. This should be specified in the documentation of the Plugin, but can also be easily find out by looking at the source (look for a top-level directory that contains a file named `__init__.py`.) |
| | 45 | |
| | 46 | == Setting up the Plugin Cache == |
| | 47 | |
| | 48 | Some plugins will need to be extracted by the Python eggs runtime (`pkg_resources`), so that their contents are actual files on the file system. The directory in which they are extracted defaults to the home directory of the current user, which may or may not be a problem. You can however override the default location using the `PYTHON_EGG_CACHE` environment variable. |
| | 49 | |
| | 50 | To do this from the Apache configuration, use the `SetEnv` directive as follows: |
| | 51 | {{{ |
| | 52 | SetEnv PYTHON_EGG_CACHE /path/to/dir |
| | 53 | }}} |
| | 54 | |
| | 55 | This works whether your using the [wiki:TracCgi CGI] or the [wiki:TracModPython mod_python] front-end. Put this directive next to where you set the path to the [wiki:TracEnvironment Trac environment], i.e. in the same `<Location>` block. |
| | 56 | |
| | 57 | For example (for CGI): |
| | 58 | {{{ |
| | 59 | <Location /trac> |
| | 60 | SetEnv TRAC_ENV /path/to/projenv |
| | 61 | SetEnv PYTHON_EGG_CACHE /path/to/dir |
| | 62 | </Location> |
| | 63 | }}} |
| | 64 | |
| | 65 | or (for mod_python): |
| | 66 | {{{ |
| | 67 | <Location /trac> |
| | 68 | SetHandler mod_python |
| | 69 | ... |
| | 70 | SetEnv PYTHON_EGG_CACHE /path/to/dir |
| | 71 | </Location> |
| | 72 | }}} |
| | 73 | |
| | 74 | For [wiki:TracFastCgi FastCGI], you'll need to `-initial-env` option, or whatever is provided by your web server for setting environment variables. |
| | 75 | |
| | 76 | ---- |
| | 77 | See also TracGuide, [http://projects.edgewall.com/trac/wiki/PluginList plugin list], [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture component architecture] |