[Moin-devel] CVS: MoinMoin Page.py,1.105,1.106 config.py,1.59,1.60 wikimacro.py,1.32,1.33 wikiutil.py,1.82,1.83
J?rgen Hermann
jhermann at users.sourceforge.net
Wed Mar 6 14:37:08 EST 2002
Update of /cvsroot/moin/MoinMoin
In directory usw-pr-cvs1:/tmp/cvs-serv4474
Modified Files:
Page.py config.py wikimacro.py wikiutil.py
Log Message:
Removed most page name configs; replaced by getSysPage()
Index: Page.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/Page.py,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -r1.105 -r1.106
*** Page.py 27 Feb 2002 21:27:24 -0000 1.105
--- Page.py 6 Mar 2002 22:36:52 -0000 1.106
***************
*** 489,493 ****
wikiutil.quoteWikiname(self.page_name), template_param,
_('Reduce editor size'))
! print "|", Page(config.page_edit_tips).link_to()
if preview:
print '| <a href="#preview">%s</a>' % _('Skip to preview')
--- 489,493 ----
wikiutil.quoteWikiname(self.page_name), template_param,
_('Reduce editor size'))
! print "|", wikiutil.getSysPage('HelpOnFormatting').link_to()
if preview:
print '| <a href="#preview">%s</a>' % _('Skip to preview')
Index: config.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/config.py,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -r1.59 -r1.60
*** config.py 21 Feb 2002 22:03:27 -0000 1.59
--- config.py 6 Mar 2002 22:36:52 -0000 1.60
***************
*** 37,45 ****
url_prefix = '.'
- # 2001-07-03: renamed recent_changes to page_recent_changes
- if not vars().has_key('page_recent_changes') and vars().has_key('recent_changes'):
- page_recent_changes = recent_changes
- del recent_changes
-
# 2001-07-03: renamed front_page to page_front_page
if not vars().has_key('page_front_page') and vars().has_key('front_page'):
--- 37,40 ----
***************
*** 137,149 ****
# page names
'page_front_page': 'FrontPage',
- 'page_site_navigation': 'SiteNavigation',
- 'page_edit_tips': 'HelpOnFormatting',
- 'page_user_prefs': 'UserPreferences',
- 'page_recent_changes': 'RecentChanges',
'page_template_ending': 'Template',
'page_form_ending': 'Form',
'page_local_spelling_words': 'LocalSpellingWords',
- 'page_title_index': 'TitleIndex',
- 'page_word_index': 'WordIndex',
'page_footer1': """<hr><a href="http://www.python.org/"><img align="right" vspace="10"
--- 132,138 ----
***************
*** 153,157 ****
'page_icons': '''
<a href="%(scriptname)s/%(page_help_contents)s"><img src="%(url)s/img/moin-help.gif" width="12" height="11" border="0" hspace="2" align="right" alt="%(page_help_contents)s"></a>
! <a href="%(scriptname)s/FindPage?value=%(pagename)s"><img src="%(url)s/img/moin-search.gif" width="12" height="12" border="0" hspace="2" align="right" alt="Search"></a>
<a href="%(scriptname)s/%(pagename)s?action=diff"><img src="%(url)s/img/moin-diff.gif" width="15" height="11" border="0" hspace="2" align="right" alt="Diffs"></a>
<a href="%(scriptname)s/%(pagename)s?action=info"><img src="%(url)s/img/moin-info.gif" width="12" height="11" border="0" hspace="2" align="right" alt="Info"></a>
--- 142,146 ----
'page_icons': '''
<a href="%(scriptname)s/%(page_help_contents)s"><img src="%(url)s/img/moin-help.gif" width="12" height="11" border="0" hspace="2" align="right" alt="%(page_help_contents)s"></a>
! <a href="%(scriptname)s/%(page_find_page)s?value=%(pagename)s"><img src="%(url)s/img/moin-search.gif" width="12" height="12" border="0" hspace="2" align="right" alt="Search"></a>
<a href="%(scriptname)s/%(pagename)s?action=diff"><img src="%(url)s/img/moin-diff.gif" width="15" height="11" border="0" hspace="2" align="right" alt="Diffs"></a>
<a href="%(scriptname)s/%(pagename)s?action=info"><img src="%(url)s/img/moin-info.gif" width="12" height="11" border="0" hspace="2" align="right" alt="Info"></a>
Index: wikimacro.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikimacro.py,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** wikimacro.py 13 Feb 2002 21:13:52 -0000 1.32
--- wikimacro.py 6 Mar 2002 22:36:52 -0000 1.33
***************
*** 100,110 ****
<input type="hidden" name="action" value="%s">
<input name="value" size="30" value="%s">
! <input type="submit" value="Go">
! </form>""" % (type, default))
def _macro_GoTo(self, args):
return self.formatter.rawHTML("""<form method="get"><input name="goto" size="30">
! <input type="submit" value="Go">
! </form>""")
def _macro_WordIndex(self, args):
--- 100,110 ----
<input type="hidden" name="action" value="%s">
<input name="value" size="30" value="%s">
! <input type="submit" value="%s">
! </form>""" % (type, default, _("Go")))
def _macro_GoTo(self, args):
return self.formatter.rawHTML("""<form method="get"><input name="goto" size="30">
! <input type="submit" value="%s">
! </form>""" % _("Go"))
def _macro_WordIndex(self, args):
Index: wikiutil.py
===================================================================
RCS file: /cvsroot/moin/MoinMoin/wikiutil.py,v
retrieving revision 1.82
retrieving revision 1.83
diff -C2 -r1.82 -r1.83
*** wikiutil.py 1 Mar 2002 19:21:25 -0000 1.82
--- wikiutil.py 6 Mar 2002 22:36:52 -0000 1.83
***************
*** 11,15 ****
import os, re, string, sys, urllib
from MoinMoin import config, user, util, version, webapi
! from MoinMoin.i18n import _
--- 11,15 ----
import os, re, string, sys, urllib
from MoinMoin import config, user, util, version, webapi
! from MoinMoin.i18n import _, getText
***************
*** 196,199 ****
--- 196,213 ----
+ def getSysPage(pagename):
+ """ Get a system page according to user settings and available
+ translations.
+ """
+ from MoinMoin.Page import Page
+
+ i18n_name = getText(pagename)
+ if i18n_name != pagename:
+ i18n_page = Page(i18n_name)
+ if i18n_page.exists():
+ return i18n_page
+ return Page(pagename)
+
+
#############################################################################
### Searching
***************
*** 391,397 ****
# get name of help page
! help_contents = _('HelpContents')
! if not Page(help_contents).exists():
! help_contents = 'HelpContents'
# print the HTML <HEAD> element
--- 405,415 ----
# get name of help page
! page_help_contents = getSysPage('HelpContents').page_name
! page_title_index = getSysPage('TitleIndex').page_name
! page_word_index = getSysPage('WordIndex').page_name
! page_site_navigation = getSysPage('SiteNavigation').page_name
! page_user_prefs = getSysPage('UserPreferences').page_name
! page_recent_changes = getSysPage('RecentChanges').page_name
! page_edit_tips = getSysPage('HelpOnFormatting').page_name
# print the HTML <HEAD> element
***************
*** 417,423 ****
print '<link rel="Alternate" media="print" title="Print" href="%s?action=print">' % (
quoteWikiname(keywords['pagename']),)
! print '<link rel="Index" href="%s">' % quoteWikiname(config.page_title_index)
! print '<link rel="Glossary" href="%s">' % quoteWikiname(config.page_word_index)
! print '<link rel="Help" href="%s">' % quoteWikiname(config.page_edit_tips)
print "</head>"
--- 435,441 ----
print '<link rel="Alternate" media="print" title="Print" href="%s?action=print">' % (
quoteWikiname(keywords['pagename']),)
! print '<link rel="Index" href="%s">' % quoteWikiname(page_title_index)
! print '<link rel="Glossary" href="%s">' % quoteWikiname(page_word_index)
! print '<link rel="Help" href="%s">' % quoteWikiname(page_edit_tips)
print "</head>"
***************
*** 460,465 ****
print '<td valign="bottom" align="left" nowrap>'
print '<font face="Verdana" size="1">%s<br> </font>' % (
! link_tag(quoteWikiname(config.page_user_prefs),
! (config.page_user_prefs, user.current.name)[user.current.valid]),)
print '</td></tr></table>'
--- 478,483 ----
print '<td valign="bottom" align="left" nowrap>'
print '<font face="Verdana" size="1">%s<br> </font>' % (
! link_tag(quoteWikiname(page_user_prefs),
! (page_user_prefs, user.current.name)[user.current.valid]),)
print '</td></tr></table>'
***************
*** 474,478 ****
'url': config.url_prefix,
'pagename': quoteWikiname(pagename),
! 'page_help_contents': help_contents,
}
if not user.current.isSubscribedTo([pagename]):
--- 492,497 ----
'url': config.url_prefix,
'pagename': quoteWikiname(pagename),
! 'page_help_contents': page_help_contents,
! 'page_find_page': getSysPage('FindPage').page_name,
}
if not user.current.isSubscribedTo([pagename]):
***************
*** 493,501 ****
'sitename': config.sitename,
'page_front_page': config.page_front_page,
! 'page_site_navigation': config.page_site_navigation,
! 'page_recent_changes': config.page_recent_changes,
! 'page_title_index': config.page_title_index,
! 'page_word_index': config.page_word_index,
! 'page_help_contents': help_contents,
}
--- 512,520 ----
'sitename': config.sitename,
'page_front_page': config.page_front_page,
! 'page_site_navigation': page_site_navigation,
! 'page_recent_changes': page_recent_changes,
! 'page_title_index': page_title_index,
! 'page_word_index': page_word_index,
! 'page_help_contents': page_help_contents,
}
***************
*** 575,579 ****
}
! print link_tag('FindPage?value='+urllib.quote_plus(pagename, ''), _('FindPage'))
print _(" by browsing, title search %(titlesearch)s, "
"text search %(textsearch)s or an index<br>") % locals()
--- 594,598 ----
}
! print link_tag(getSysPage('FindPage').page_name+'?value='+urllib.quote_plus(pagename, ''), _('FindPage'))
print _(" by browsing, title search %(titlesearch)s, "
"text search %(textsearch)s or an index<br>") % locals()
More information about the Moin-devel
mailing list