Changeset 501

Show
Ignore:
Timestamp:
10/15/09 10:56:27 (5 years ago)
Author:
ged
Message:

PEP8 improvements in examples. Not sure it's worth it, since it is so outdated.

Location:
elixir/trunk/examples/videostore
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • elixir/trunk/examples/videostore/start-videostore.py

    r11 r501  
    1414# probably installed 
    1515if len(sys.argv) > 1: 
    16     update_config(configfile=sys.argv[1],  
     16    update_config(configfile=sys.argv[1], 
    1717        modulename="videostore.config") 
    1818elif exists(join(dirname(__file__), "setup.py")): 
  • elixir/trunk/examples/videostore/videostore/controllers/root.py

    r298 r501  
    77 
    88class Root(RootController): 
    9      
     9 
    1010    @expose(template='videostore.templates.index') 
    1111    @identity.require(identity.not_anonymous()) 
    1212    def index(self): 
    1313        return dict(movies=Movie.query.all()) 
    14      
    15      
     14 
     15 
    1616    @expose(template='videostore.templates.movie') 
    1717    @identity.require(identity.not_anonymous()) 
     
    1919    def movie(self, movieID): 
    2020        return dict(movie=Movie.get(movieID)) 
    21      
    22      
     21 
     22 
    2323    @expose(template='videostore.templates.actor') 
    2424    @identity.require(identity.not_anonymous()) 
     
    2626    def actor(self, actorID): 
    2727        return dict(actor=Actor.get(actorID)) 
    28      
    29      
     28 
     29 
    3030    @expose(template='videostore.templates.director') 
    3131    @identity.require(identity.not_anonymous()) 
     
    3333    def director(self, directorID): 
    3434        return dict(director=Director.get(directorID)) 
    35      
    36      
     35 
     36 
    3737    @expose(template='videostore.templates.login') 
    3838    def login(self, forward_url=None, previous_url=None, *args, **kw): 
     
    4141               identity.get_identity_errors(): 
    4242            raise redirect(forward_url) 
    43          
     43 
    4444        forward_url = None 
    4545        previous_url = request.path 
    46          
     46 
    4747        if identity.was_login_attempted(): 
    4848            msg = 'The credentials you supplied were not correct.' 
     
    5252            msg = 'Please log in.' 
    5353            forward_url = request.headers.get('Referer', '/') 
    54          
     54 
    5555        response.status = 403 
    56         return dict(message=msg,  
    57                     previous_url=previous_url,  
     56        return dict(message=msg, 
     57                    previous_url=previous_url, 
    5858                    logging_in=True, 
    5959                    original_parameters=request.params, 
    6060                    forward_url=forward_url) 
    61      
    62      
     61 
     62 
    6363    @expose() 
    6464    def logout(self): 
  • elixir/trunk/examples/videostore/videostore/model.py

    r316 r501  
    2929    movies = ManyToMany('Movie', inverse='actors', tablename='movie_casting') 
    3030    using_options(tablename='actors') 
    31     
     31 
    3232 
    3333# 
    3434# identity model 
    35 #  
     35# 
    3636 
    3737class Visit(Entity): 
     
    4040    expiry = Field(DateTime) 
    4141    using_options(tablename='visit') 
    42      
     42 
    4343    @classmethod 
    4444    def lookup_visit(cls, visit_key): 
     
    6868    groups = ManyToMany('Group', inverse='users') 
    6969    using_options(tablename='tg_user') 
    70      
     70 
    7171    @property 
    7272    def permissions(self): 
  • elixir/trunk/examples/videostore/videostore/tests/test_controllers.py

    r11 r501  
    77def teardown_func(): 
    88    """Tests for apps using identity need to stop CP/TG after each test to 
    9     stop the VisitManager thread. See http://trac.turbogears.org/turbogears/ticket/1217 
    10     for details. 
     9    stop the VisitManager thread. 
     10    See http://trac.turbogears.org/turbogears/ticket/1217 for details. 
    1111    """ 
    1212    turbogears.startup.stopTurboGears()