Changes between Version 10 and Version 11 of EggCookingTutorial/BasicEggCooking
- Timestamp:
- Oct 1, 2005, 12:41:15 AM (19 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EggCookingTutorial/BasicEggCooking
v10 v11 26 26 == Main plugin == 27 27 28 First step is to generate main module for this plugin. We will construct simple plugin that will display "Hello world!" on screen when accessed through /helloworld URL. Plugin also provides "Hello" button that is by default rendered on far right inmain navigation bar.28 The first step is to generate the main module for this plugin. We will construct a simple plugin that will display "Hello world!" on the screen when accessed through /helloworld URL. The plugin also provides a "Hello" button that is, by default, rendered on the far right in the main navigation bar. 29 29 30 30 So create ''helloworld.py'' in ''./helloworld-plugin/helloworld/'': … … 61 61 }}} 62 62 63 == Make it a s amodule ==63 == Make it a module == 64 64 65 Since this is not enough, we need to make our simple plugin as a module. To do so, you simply create that magic ''_''____''_init_''____''_.py'' into''./helloworld-plugin/helloworld/'':65 To make the plugin a module, you simply create that magic ''_''____''_init_''____''_.py'' in ''./helloworld-plugin/helloworld/'': 66 66 {{{ 67 67 #!python … … 70 70 }}} 71 71 72 == Make it a s an egg ==72 == Make it an egg == 73 73 74 Now it's time to make it a s an egg. For that we need a chicken called ''setup.py'' that is created into''./helloworld-plugin/'':74 Now it's time to make it an egg. For that we need a chicken called ''setup.py'' in ''./helloworld-plugin/'': 75 75 {{{ 76 76 #!python … … 83 83 }}} 84 84 85 To make egg loadable in Trac we need to create one file more. in ''./helloworld-plugin/!TracHelloworld.egg-info/'' create file ''trac_plugin.txt'':85 To make the egg loadable in Trac we need to create one more file. In ''./helloworld-plugin/!TracHelloworld.egg-info/'' create the file ''trac_plugin.txt'': 86 86 {{{ 87 87 helloworld … … 90 90 == First deployment == 91 91 92 Now you could try to build your first plugin. Run command {{{python setup.py bdist_egg}}} in directory where you created it. If everthing went OK you should have small.egg file in ''./dist'' directory.92 Now try to build the plugin. Run the command {{{python setup.py bdist_egg}}} in the directory where you created it. If everthing went OK you should have a .egg file in ''./dist'' directory. 93 93 94 94 Copy this ''.egg'' file to ''/[your trac env]/plugins'' directory. If you're using mod_python you have to restart Apache. … … 98 98 == Aftermath == 99 99 100 Now you have successfully created your first egg. You can continue now reading [wiki:EggCookingTutorial/AdvancedEggCooking EggCookingTutorial/AdvancedEggCooking] to really integrate plugin into Trac layout. 101 100 Now you have successfully created your first egg. You can continue by reading [wiki:EggCookingTutorial/AdvancedEggCooking EggCookingTutorial/AdvancedEggCooking] to learn how to use Trac templates.