Changeset 1651

Show
Ignore:
Timestamp:
12/05/06 12:20:17 (2 years ago)
Author:
Blackhex
Message:

GuestbookPlugin:

Plugin ported to Trac 0.10.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • guestbookplugin/0.10/guestbook/core.py

    r431 r1651  
    1515from trac.util import Markup, format_datetime 
    1616 
    17 # Local includes 
    18 from guestbook.db import version, schema 
    19  
    2017""" 
    2118  Guestbook plugin for Trac. Allows to get some feedback from anonymous users 
     
    2825    # 
    2926 
    30     implements(IEnvironmentSetupParticipant, IPermissionRequestor, 
    31       INavigationContributor, ITemplateProvider, IRequestHandler) 
    32  
    33     # IEnvironmentSetupParticipant 
    34  
    35     """ 
    36  
    37     """ 
    38     def environment_created(self): 
    39         pass 
    40  
    41     """ 
    42       Determines if database is of same version as is version of this plugin. 
    43     """ 
    44     def environment_needs_upgrade(self, db): 
    45         cursor = db.cursor() 
    46         try: 
    47             cursor.execute("SELECT value FROM system WHERE name='guestbook_version'") 
    48             for row in cursor: 
    49                 return int(row[0]) != version 
    50             return True 
    51         except: 
    52             return True 
    53  
    54     """ 
    55       Creates or upgrades database to current version. 
    56     """ 
    57     def upgrade_environment(self, db): 
    58         cursor = db.cursor() 
    59         for table in schema: 
    60             queries = db.to_sql(table) 
    61             for query in queries: 
    62                 cursor.execute(query) 
    63         cursor.execute("INSERT INTO system VALUES ('guestbook_version', %s)", 
    64           [version]) 
    65         #except: 
    66           #cursor.execute("UPDATE system SET value = %i WHERE name = 'discussion_version'", discussion_version) 
     27    implements(IPermissionRequestor, INavigationContributor, ITemplateProvider, 
     28      IRequestHandler) 
    6729 
    6830    # IPermissionRequestor methods 
  • guestbookplugin/0.10/setup.py

    r547 r1651  
    55 
    66setup( 
    7   name='TracGuestbook', 
    8   version='0.1', 
    9   author='Radek Bartoň', 
    10   author_email='blackhex@post.cz', 
    11   description='Guestbook plugin for Trac', 
    12   long_description='', 
    13   url='http://trac-hacks.swapoff.org/wiki/GuestbookPlugin', 
    14   keywords='trac guestbook', 
    15   packages=['guestbook'], 
    16   package_data={'guestbook': ['templates/*.cs', 'htdocs/css/*.css']}, 
    17   entry_points={'trac.plugins': 'TracGuestbook = guestbook.core'}) 
     7  name = 'TracGuestbook', 
     8  version = '0.2', 
     9  packages = ['guestbook', 'guestbook.db'], 
     10  package_data = {'guestbook': ['templates/*.cs', 'htdocs/css/*.css']}, 
     11  entry_points = {'trac.plugins': ['TracGuestbook.core = guestbook.core', 
     12                                   'TracGuestbook.init = guestbook.init']}, 
     13  keywords = 'trac guestbook', 
     14  author = 'Radek Bartoň', 
     15  author_email = 'blackhex@post.cz', 
     16  url = 'http://trac-hacks.swapoff.org/wiki/GuestbookPlugin', 
     17  description = 'Guestbook plugin for Trac', 
     18  license = '''GPL''' 
     19