Created
July 22, 2011 15:05
-
-
Save evandrix/1099628 to your computer and use it in GitHub Desktop.
TracPlugin: Minimal implementation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from logplugin import * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+-plugin-log/ | |
| | |
+-logpackage/ | |
| | | |
| +-__init__.py | |
| | | |
| +-logplugin.py | |
| | |
+-setup.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from trac.core import implements, Component | |
from trac.env import IEnvironmentSetupParticipant | |
class SampleEnvironmentSetupParticipant(Component): | |
implements(IEnvironmentSetupParticipant) | |
# IEnvironmentSetupParticipant methods | |
def environment_created(self): | |
self.log.debug("creating environment for sample plugin.") | |
pass | |
def environment_needs_upgrade(self, db): | |
self.log.debug("the existing environment requires an upgrade for sample plugin.") | |
return True | |
def upgrade_environment(self, db): | |
self.log.debug("upgrading existing environment for sample plugin.") | |
pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from setuptools import find_packages, setup | |
setup( | |
name='TracLog', version='1.0', | |
packages=find_packages(exclude=['*.tests']), | |
entry_points = { | |
'trac.plugins': [ | |
'logplugin = logpackage.logplugin', | |
], | |
}, | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
setup.py: add the following lines if additional resource data needs to be included with package