Changeset 15065


Ignore:
Timestamp:
Nov 19, 2015, 3:34:39 AM (5 years ago)
Author:
Ryan J Ollos
Message:

0.1.4: Conform to PEP8

Location:
sharedcookieauthplugin/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sharedcookieauthplugin/trunk/setup.py

    r12348 r15065  
    11from setuptools import find_packages, setup
    22
    3 version='0.1.4'
    4 
    53setup(name='SharedCookieAuth',
    6       version=version,
     4      version='0.1.4',
    75      description="share cookies between trac projects in the same directory",
    86      author='Jeff Hammel',
     
    1513      packages=find_packages(exclude=['ez_setup', 'examples', 'tests*']),
    1614      include_package_data=True,
    17       package_data={ 'sharedcookieauth': ['templates/*', 'htdocs/*'] },
     15      package_data={'sharedcookieauth': ['templates/*', 'htdocs/*']},
    1816      zip_safe=False,
    19       entry_points = """
     17      entry_points="""
    2018      [trac.plugins]
    21       sharedcookieauth = sharedcookieauth
     19      sharedcookieauth = sharedcookieauth.SharedCookieAuth
    2220      """,
    2321      )
    24 
  • sharedcookieauthplugin/trunk/sharedcookieauth/__init__.py

    r12348 r15065  
    1 #
    2 from sharedcookieauth import *
  • sharedcookieauthplugin/trunk/sharedcookieauth/sharedcookieauth.py

    r15064 r15065  
    88
    99from trac.core import *
     10from trac.env import open_environment
    1011from trac.web.api import IAuthenticator
    1112from trac.web.main import RequestDispatcher
    12 from trac.env import open_environment
    1313
    1414
    1515class SharedCookieAuth(Component):
    1616
    17     ### class-level data
    1817    implements(IAuthenticator)
    1918
    20     ### method for IAuthenticator
     19    # IAuthenticator methods
    2120
    2221    def authenticate(self, req):
     
    2928        else:
    3029            req.environ['shared_cookie_auth'] = None
    31             if req.incookie.has_key('trac_auth'):
     30            if 'trac_auth' in req.incookie:
    3231                for project, dispatcher in self.dispatchers().items():
    3332                    agent = dispatcher.authenticate(req)
     
    3938        return None
    4039
    41     ### internal methods
     40    # Internal methods
    4241
    4342    def dispatchers(self):
    4443        if not hasattr(self, '_dispatchers'):
    45 
    4644            dispatchers = {}
    4745            base_path, project = os.path.split(self.env.path)
    48             projects = [ i for i in os.listdir(base_path)
    49                          if i != project ]
     46            projects = [i for i in os.listdir(base_path) if i != project]
    5047
    5148            for project in projects:
Note: See TracChangeset for help on using the changeset viewer.