annotate MoinMoin/theme/modernized_cms.py @ 6106:b59ee217581c

remove MoinMoin.support.HeaderFixed assuming it is fixed in 2.7. no idea what the problem was, comments unhelpful.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 06 Sep 2016 01:52:01 +0200
parents 716dcfb00e8e
children
rev   line source
4635
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
1 # -*- coding: iso-8859-1 -*-
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
2 """
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
3 MoinMoin - modernized_cms theme
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
4
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
5 @copyright: 2009 MoinMoin:ThomasWaldmann
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
6 @license: GNU GPL, see COPYING for details.
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
7 """
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
8
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 from MoinMoin.theme.modernized import Theme as ThemeBase
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
10
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11 class Theme(ThemeBase):
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
12
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
13 name = "modernized" # we tell that we are 'modernized', so we use its static data
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
14
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
15 def onlyloggedin(method):
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16 """ decorator that returns empty string for not logged-in users,
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
17 otherwise it calls the decorated method
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
18 """
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 return lambda self, *args, **kwargs: (
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
20 self.request.user.valid and self.request.user.name and method(self, *args, **kwargs)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 or
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 ''
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
23 )
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
24
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
25 interwiki = onlyloggedin(ThemeBase.interwiki)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
26 title = onlyloggedin(ThemeBase.title)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
27 username = onlyloggedin(ThemeBase.username)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
28 pageinfo = onlyloggedin(ThemeBase.pageinfo)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
29 editbar = onlyloggedin(ThemeBase.editbar)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
31
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
32 def execute(request):
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
33 return Theme(request)
716dcfb00e8e added modernized_cms theme
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34