Changes between Version 21 and Version 22 of EggCookingTutorialTrac0.11
- Timestamp:
- Sep 15, 2015, 5:16:08 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EggCookingTutorialTrac0.11
v21 v22 70 70 == Make it a module == 71 71 72 To make the plugin a module, you simply create an ''_''____''_init_''____''_.py'' in ''./helloworld-plugin/helloworld/'': 73 {{{ 74 #!python 75 # Helloworld module 72 To make the plugin a module, you simply create an `__init__.py` in `helloworld-plugin/helloworld/`: 73 {{{#!python 76 74 from helloworld import * 77 75 }}} … … 80 78 81 79 Now it's time to make it an egg. For that we need a chicken called ''setup.py'' in ''./helloworld-plugin/'': 82 {{{ 83 #!python 80 {{{#!python 84 81 from setuptools import find_packages, setup 85 82 … … 101 98 == First deployment == 102 99 103 Now try to build the plugin. Run the command {{{python setup.py bdist_egg}}} in the directory where you created it. If everything went OK you should have a .egg file in ''./dist'' directory. 104 Copy this ''.egg'' file to ''/[your trac env]/plugins'' directory. 100 Now try to build the plugin. Run the command `python setup.py bdist_egg` in the directory where you created `setup.py`. If everything went OK you should have a `.egg` file in the newly-created `dist` directory. 101 102 Copy the `.egg` file to your `$env/plugins` directory. If you are running a web server, rather than TracStandalone, you will need to restart the web server. 105 103 106 104 During development you can run the command {{{python setup.py develop}}} in the directory where you created it. This way you don't need to do it every time you change the code. Check [trac:TracDev/PluginDevelopment] for more deployment options. 107 105 108 Edit the conf/trac.ini file by adding {{{helloworld.* = enabled}}} in the {{{[components]}}} section. 109 110 Copy this .egg file to /[your trac env]/plugins directory. Restart the trac server. If you're using mod_python you have to restart Apache. 106 Edit the `$env/conf/trac.ini` file by adding `helloworld.* = enabled` in the `[components]` section. 111 107 112 108 Now you should see a ''Hello World'' link on the far right in the main navigation bar when accessing your site. Click it. … … 342 338 343 339 == The egg grows == 344 345 Natural eggs don't dron, Python ones do.346 340 347 341 Modify ''setup.py'' to include our static data: