Other Text Items

Sample Text items are transcluded below.

Plain Text

aaaa
bb
cccc

eee
fff
ggggggg

CSV

FruitColorQuantity
apple red5
plumpurple3
kiwibrown7

Python

# Copyright: 2011 MoinMoin:MichaelMayorov
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.

"""
MoinMoin - MoinMoin search package
"""

from MoinMoin.i18n import L_
from MoinMoin.forms import Search, InlineCheckbox

from flatland import Form, String, Boolean
from flatland.validation import Validator


class ValidSearch(Validator):
    """Validator for a valid search form
    """
    too_short_query_msg = L_('Search query too short.')

    def validate(self, element, state):
        if element['q'].value is None:
            # no query, nothing to search for
            return False
        if len(element['q'].value) < 2:
            return self.note_error(element, state, 'too_short_query_msg')
        return True


class SearchForm(Form):
    q = Search
    history = InlineCheckbox.using(label=L_('search all revisions'))
    submit_label = L_('Search')

    validators = [ValidSearch()]

IRC Log

(1:30:04 PM) The topic for #moin-dev is: MoinMoin Developer Channel - this channel is publicly logged - Pastebin: http://rn0.ru/ - just ask/tell AND WAIT.
(1:30:04 PM) Topic for #moin-dev set by ThomasWaldmann!~twaldmann@moinmoin/coreteam/thomas at 1:10:26 AM on 8/13/2012
328: http://moinmo.in/
(2:08:57 PM) moinmoin left the room (quit: Quit: Client exiting).

Diff

# HG changeset patch
# Date 1402234718 -7200
#      Sun Jun 08 15:38:38 2014 +0200
# Node ID aa093f88e018777d1773b47ce7d04d760d8a5114
# Parent  fa6943d4dac7107726517ae2f0a49c7869a5036c
remove redundant parentheses

diff -r fa6943d4dac7 -r aa093f88e018 MoinMoin/apps/frontend/views.py
--- a/MoinMoin/apps/frontend/views.py    Sun Jun 08 15:34:29 2014 +0200
+++ b/MoinMoin/apps/frontend/views.py    Sun Jun 08 15:38:38 2014 +0200
@@ -198,7 +198,7 @@
                     ITEMLINKS, ITEMTRANSCLUSIONS, 'refs', ]:
             value = lookup_form[key].value
             if value:
-                if (key in [ITEMID, REVID, USERID, ] and len(value) < crypto.UUID_LEN or key in [NAME_EXACT]):
+                if key in [ITEMID, REVID, USERID, ] and len(value) < crypto.UUID_LEN or key in [NAME_EXACT]:
                     term = Prefix(key, value)
                 elif key == 'refs':
                     term = Or([Term(ITEMLINKS, value), Term(ITEMTRANSCLUSIONS, value)])
@@ -1324,7 +1324,7 @@
     success = False
     if u and token and u.validate_recovery_token(token):
         unvalidated_email = u.profile[EMAIL_UNVALIDATED]
-        if (app.cfg.user_email_unique and user.search_users(**{EMAIL: unvalidated_email})):
+        if app.cfg.user_email_unique and user.search_users(**{EMAIL: unvalidated_email}):
             msg = _('This email is already in use.')
         else:
             if u.disabled:
diff -r fa6943d4dac7 -r aa093f88e018 MoinMoin/apps/misc/views.py
--- a/MoinMoin/apps/misc/views.py    Sun Jun 08 15:34:29 2014 +0200
+++ b/MoinMoin/apps/misc/views.py    Sun Jun 08 15:38:38 2014 +0200
@@ -37,7 +37,7 @@
         # these are the content items:
         changefreq = "daily"
         priority = "0.5"
-        sitemap += [((fqname, format_timestamp(mtime), changefreq, priority)) for fqname in fqnames]
+        sitemap += [(fqname, format_timestamp(mtime), changefreq, priority) for fqname in fqnames]
     # add entries for root urls
     root_mapping = [(namespace, app.cfg.root_mapping.get(namespace, app.cfg.default_root)) for namespace, _ in app.cfg.namespace_mapping]
     query = Or([And([Term(NAME_EXACT, root), Term(NAMESPACE, namespace)]) for namespace, root in root_mapping])