changeset 3903:0f86861f1adb

merged some 1.7 changesets
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Jul 2008 14:08:14 +0200
parents fec6c6ccfc0b (current diff) 4431145e4994 (diff)
children a452a1dab1f7
files .hgtags MoinMoin/__init__.py MoinMoin/action/_tests/test_cache.py MoinMoin/action/cache.py MoinMoin/parser/text_moin_wiki.py MoinMoin/version.py docs/CHANGES moin.spec wiki/config/more_samples/ui_wikiconfig_snippet wiki/config/wikiconfig.py wiki/config/wikifarm/farmconfig.py wiki/data/meta wiki/server/moin.wsgi wiki/server/mointwisted.py wiki/server/wikiserverconfig.py wikiconfig.py
diffstat 7 files changed, 42 insertions(+), 26 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_packages.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/_tests/test_packages.py	Sun Jul 27 14:08:14 2008 +0200
@@ -84,11 +84,9 @@
 
 class TestRealCreation:
 
-    def testSearchCreate(self):
+    def testSearch(self):
         package = PackagePages(self.request.rootpage.page_name, self.request)
-        temp = tempfile.NamedTemporaryFile(suffix='.zip')
-        package.collectpackage(package.searchpackage(self.request, "Category"), temp)
-        assert zipfile.is_zipfile(temp.name)
+        assert package.searchpackage(self.request, "Bad") == [u'BadContent']
 
     def testListCreate(self):
         package = PackagePages(self.request.rootpage.page_name, self.request)
--- a/MoinMoin/action/_tests/test_cache.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/action/_tests/test_cache.py	Sun Jul 27 14:08:14 2008 +0200
@@ -68,10 +68,10 @@
                                         arena=cache.cache_arena,
                                         scope=cache.cache_scope,
                                         key=key+'.meta', use_pickle=True)
-        last_modified, headers = meta_cache.content()
-        assert last_modified.endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
-        assert "Content-Type: application/octet-stream" in headers
-        assert "Content-Length: %d" % len(data) in headers
+        meta = meta_cache.content()
+        assert meta['httpdate_last_modified'].endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
+        assert "Content-Type: application/octet-stream" in meta['headers']
+        assert "Content-Length: %d" % len(data) in meta['headers']
 
     def test_put_cache_guess_ct_give_lm(self):
         """Test if put_cache() works, when we give filename (so it guesses content_type) and last_modified"""
@@ -87,10 +87,10 @@
                                         arena=cache.cache_arena,
                                         scope=cache.cache_scope,
                                         key=key+'.meta', use_pickle=True)
-        last_modified, headers = meta_cache.content()
-        assert last_modified == 'Thu, 01 Jan 1970 00:00:01 GMT'
-        assert "Content-Type: image/png" in headers
-        assert "Content-Length: %d" % len(data) in headers
+        meta = meta_cache.content()
+        assert meta['httpdate_last_modified'] == 'Thu, 01 Jan 1970 00:00:01 GMT'
+        assert "Content-Type: image/png" in meta['headers']
+        assert "Content-Length: %d" % len(data) in meta['headers']
 
     def test_put_cache_file_like_data(self):
         """Test if put_cache() works when we give it a file like object for the content"""
@@ -107,10 +107,10 @@
                                         arena=cache.cache_arena,
                                         scope=cache.cache_scope,
                                         key=key+'.meta', use_pickle=True)
-        last_modified, headers = meta_cache.content()
-        assert last_modified.endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
-        assert "Content-Type: application/octet-stream" in headers
-        assert "Content-Length: %d" % len(data) in headers
+        meta = meta_cache.content()
+        assert meta['httpdate_last_modified'].endswith(' GMT') # only a very rough check, it has used cache mtime as last_modified
+        assert "Content-Type: application/octet-stream" in meta['headers']
+        assert "Content-Length: %d" % len(data) in meta['headers']
 
         data_cache = caching.CacheEntry(request,
                                         arena=cache.cache_arena,
--- a/MoinMoin/action/cache.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/action/cache.py	Sun Jul 27 14:08:14 2008 +0200
@@ -162,7 +162,7 @@
         'httpdate_last_modified': httpdate_last_modified,
         'last_modified': last_modified,
         'headers': headers,
-        'original':original,
+        'original': original,
     })
 
 
--- a/MoinMoin/macro/MonthCalendar.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/macro/MonthCalendar.py	Sun Jul 27 14:08:14 2008 +0200
@@ -6,7 +6,7 @@
     The days are links to Wiki pages following this naming convention:
     BasePageName/year-month-day
 
-    @copyright: 2002-2007 MoinMoin:ThomasWaldmann
+    @copyright: 2002-2008 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 
     Revisions:
@@ -91,7 +91,7 @@
         * adapted to moin 1.7 new macro parameter parsing
 
     Usage:
-        <<MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6)>>
+        <<MonthCalendar(BasePage,year,month,monthoffset,monthoffset2,height6,anniversary,template)>>
 
         each parameter can be empty and then defaults to currentpage or currentdate or monthoffset=0
 
@@ -144,7 +144,7 @@
 
 This creates a calendar which uses MonthCalendarTemplate for directly editing
 nonexisting day pages:
-<<MonthCalendar(,,,,,,MonthCalendarTemplate)>>
+<<MonthCalendar(,,,,,,,MonthCalendarTemplate)>>
 """
 
 Dependencies = ['namespace', 'time', ]
@@ -221,6 +221,8 @@
         try:
             cparmpagename, cparmyear, cparmmonth, cparmoffset, cparmoffset2, cparmheight6, cparmanniversary, cparmtemplate = \
                 parseargs(request, text2, thispage, currentyear, currentmonth, 0, 0, False, False, u'')
+            # Note: cparmheight6 and cparmanniversary are not used, they are just there
+            # to have a consistent parameter string in calparms and macro args
         except (ValueError, TypeError), err:
             return macro.format_error(err)
     else:
@@ -272,7 +274,7 @@
     p = Page(request, thispage)
     qpagenames = '*'.join([wikiutil.quoteWikinameURL(pn) for pn in parmpagename])
     qtemplate = wikiutil.quoteWikinameURL(parmtemplate)
-    querystr = "calparms=%%s,%d,%d,%d,%%d,%%s" % (parmyear, parmmonth, parmoffset)
+    querystr = "calparms=%%s,%d,%d,%d,%%d,,,%%s" % (parmyear, parmmonth, parmoffset)
     prevlink = p.url(request, querystr % (qpagenames, parmoffset2 - 1, qtemplate))
     nextlink = p.url(request, querystr % (qpagenames, parmoffset2 + 1, qtemplate))
     prevylink = p.url(request, querystr % (qpagenames, parmoffset2 - 12, qtemplate))
--- a/MoinMoin/parser/text_moin_wiki.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Sun Jul 27 14:08:14 2008 +0200
@@ -1255,8 +1255,11 @@
         #logging.debug("parser_content: %r" % line)
         if self.in_pre == 'search_parser' and line.strip():
             # try to find a parser specification
+            parser_name = ''
             if line.strip().startswith("#!"):
-                parser_name = line.strip()[2:].split()[0]
+                parser_name = line.strip()[2:]
+            if parser_name:
+                parser_name = parser_name.split()[0]
             else:
                 parser_name = 'text'
             self.setParser(parser_name)
--- a/MoinMoin/script/migration/1070000.py	Sun Jul 27 13:55:04 2008 +0200
+++ b/MoinMoin/script/migration/1070000.py	Sun Jul 27 14:08:14 2008 +0200
@@ -1,13 +1,13 @@
 # -*- coding: iso-8859-1 -*-
 """
-    MoinMoin - dummy migration terminator script
+    MoinMoin - migration from base rev 1070000
 
-    This must be the last migration script.
+    Nothing to do, we just return the new data dir revision.
 
-    @copyright: 2006 by Thomas Waldmann
+    @copyright: 2008 by Thomas Waldmann
     @license: GNU GPL, see COPYING for details.
 """
 
 def execute(script, data_dir, rev):
-    return None
+    return 1070100
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MoinMoin/script/migration/1070100.py	Sun Jul 27 14:08:14 2008 +0200
@@ -0,0 +1,13 @@
+# -*- coding: iso-8859-1 -*-
+"""
+    MoinMoin - dummy migration terminator script
+
+    This must be the last migration script.
+
+    @copyright: 2006 by Thomas Waldmann
+    @license: GNU GPL, see COPYING for details.
+"""
+
+def execute(script, data_dir, rev):
+    return None
+