Changes between Version 1 and Version 2 of TracPlugins
- Timestamp:
- Dec 31, 2005, 5:43:43 PM (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracPlugins
v1 v2 1 = Trac Plugins=1 = Trac プラグイン = 2 2 [[TracGuideToc]] 3 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]. 4 バージョン 0.9 以降、 Trac はプラグインをサポートし、組み込み機能を拡張できるようになりました。プラグインの機能は [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture コンポーネント設計] に基づいています。 5 5 6 == Requirements==6 == 必要条件 == 7 7 8 T o use plugins in Trac, you need to have [http://peak.telecommunity.com/DevCenter/setuptools setuptools] (version 0.6) installed.8 Trac のプラグインを使用するためには、 [http://peak.telecommunity.com/DevCenter/setuptools setuptools] (バージョン 0.6) をインストールしなければなりません。 9 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:10 `setuptools` をインストールするために、ブートストラップモジュールである[http://peak.telecommunity.com/dist/ez_setup.py ez_setup.py]をダウンロードし、以下に示すように実行して下さい: 11 11 {{{ 12 12 $ python ez_setup.py 13 13 }}} 14 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. 15 もし `ez_setup.py` スクリプトが setuptools のインストールに失敗したら、 [http://www.python.org/pypi/setuptools PyPI] をダウンロードして手動でインストールしてください。 16 16 17 == Installing a Trac Plugin==17 == Trac プラグインのインストール == 18 18 19 === For a Single Project===19 === 単一のプロジェクト === 20 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:21 プラグインは [http://peak.telecommunity.com/DevCenter/PythonEggs Python eggs] としてパッケージ化されています。つまり、拡張子が `.egg` となっている ZIP アーカイブのファイルです。プラグインのソースコードディストリビューションをダウンロードした場合は、以下のコマンドを実行して下さい: 22 22 {{{ 23 23 $ python setup.py bdist_egg 24 24 }}} 25 to build the `.egg` file. 25 `.egg` ファイルをビルドできます。 26 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. 27 一度、プラグインアーカイブを作成したら、 [wiki:TracEnvironment TracEnvironment] の `plugins` ディレクトリにコピーする必要があります。また、 Web サーバーが egg プラグインを読み取るのに必要なパーミッションをつけてください。 28 28 29 === For All Projects===29 === すべてのプロジェクト === 30 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: 31 すべてのプロジェクトでプラグインを使用したいとき ([http://projects.edgewall.com/trac/wiki/WebAdmin WebAdmin] など) はグローバルにインストールし動かすことができます。 32 32 {{{ 33 33 $ python setup.py install 34 34 }}} 35 35 36 Alternatively, you can just drop the `.egg` file in the Python `site-packages` directory. 36 代わりに、`.egg` ファイルを Python の `site-packages` ディレクトリにおくだけでもいいです。 37 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:38 個別の TracEnvironment にプラグインをインストールする場合と異なり、システム全体にインストールしたプラグインを有効にするためには、 [wiki:TracIni trac.ini] ファイルで明示的に指定しなければいけません。これは設定ファイルの `[components]` セクションに次のような記載を行います: 39 39 {{{ 40 40 [components] … … 42 42 }}} 43 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`.)44 オプションの名前はプラグインの Python パッケージ名です。これはプラグインのドキュメンテーションに指定されていなければいけませんが、ソースを見れば簡単に見つけることが出来ます。(最上位のディレクトリにあるファイル `__init__.py` を探してください。) 45 45 46 == Setting up the Plugin Cache==46 == プラグインのキャッシュの設定 == 47 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. 48 いくつかのプラグインは Python eggs のランタイム (`pkg_resources`) によって解凍される必要があります。というのもそれらの内容がファイルシステム上に実際に存在する必要があるからです。通常、 Python eggs は現在のユーザのホームディレクトリに解凍されますが、それにより問題が発生するかもしれません。その場合、環境変数 `PYTHON_EGG_CACHE` を設定してデフォルトのロケーションを上書きすることができます。 49 49 50 To do this from the Apache configuration, use the `SetEnv` directive as follows:50 `PYTHON_EGG_CACHE` を `SetEnv` ディレクティブを使用して Apache に設定するには以下のようにします: 51 51 {{{ 52 52 SetEnv PYTHON_EGG_CACHE /path/to/dir 53 53 }}} 54 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. 55 これは [wiki:TracCgi CGI] と [wiki:TracModPython mod_python] のどちらをフロントエンドにしようと動作します。このディレクティブに [wiki:TracEnvironment Trac Environment] へのパスに設定し、例えば同じ `<Location>` ブロックにおいてください。 56 56 57 For example (for CGI):57 例 (CGI用): 58 58 {{{ 59 59 <Location /trac> … … 63 63 }}} 64 64 65 or (for mod_python):65 例 (mod_python用): 66 66 {{{ 67 67 <Location /trac> … … 72 72 }}} 73 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. 74 [wiki:TracFastCgi FastCGI] で、Web サーバに設定するためには、 `-initial-env` オプションやサーバーが指定している方法で、環境変数を設定する必要があります。 75 75 76 76 ---- 77 See also TracGuide, [http://projects.edgewall.com/trac/wiki/PluginList plugin list], [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture component architecture]77 See also: TracGuide, [http://projects.edgewall.com/trac/wiki/PluginList プラグイン一覧], [http://projects.edgewall.com/trac/wiki/TracDev/ComponentArchitecture コンポーネント設計]