changeset 5480:39cae9b6c0c8

merged main
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Tue, 02 Feb 2010 14:04:57 +0100
parents b29b47f681dd (current diff) d3e1bae851ef (diff)
children f9a7aa1a4a4a 7f5b3389a7e1
files
diffstat 4 files changed, 14 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_packages.py	Tue Feb 02 14:01:55 2010 +0100
+++ b/MoinMoin/_tests/test_packages.py	Tue Feb 02 14:04:57 2010 +0100
@@ -3,7 +3,8 @@
     MoinMoin - MoinMoin.packages tests
 
     @copyright: 2005 MoinMoin:AlexanderSchremmer,
-                2007 Federico Lorenzi
+                2007 Federico Lorenzi,
+                2010 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -34,14 +35,10 @@
 print|foo
 ReplaceUnderlay|testdatei|TestSeite2
 IgnoreExceptions|True
-DeletePage|TestSeiteDoesNotExist|Test ...
-DeletePage|FooPage|Test ...
 IgnoreExceptions|False
 AddRevision|foofile|FooPage
 AddRevision|foofile|FooPage
-setthemename|foo
 #foobar
-installplugin|foo|local|parser|testy
 """
 
     def extract_file(self, filename):
@@ -66,9 +63,7 @@
             py.test.skip('This test needs to be run using the test wiki.')
 
     def teardown_class(self):
-        DebugPackage(self.request, u"""moinmoinpackage|1
-DeletePage|FooPage|Test ...
-""").installPackage()
+        nuke_page(self.request, "FooPage")
 
     def testBasicPackageThings(self):
         become_superuser(self.request)
--- a/MoinMoin/config/multiconfig.py	Tue Feb 02 14:01:55 2010 +0100
+++ b/MoinMoin/config/multiconfig.py	Tue Feb 02 14:04:57 2010 +0100
@@ -430,6 +430,9 @@
     openid_server_restricted_users_group = None
     openid_server_enable_user = False
 
+    # actions to exclude from packagepages action
+    packagepages_actions_excluded = ['setthemename', 'copythemefile', 'installplugin', 'renamepage', 'deletepage', 'delattachment']
+
     page_credits = [
         # Feel free to add other credits, but PLEASE do NOT change or remove
         # the following links - you help us by keeping them "as is":
--- a/MoinMoin/packages.py	Tue Feb 02 14:01:55 2010 +0100
+++ b/MoinMoin/packages.py	Tue Feb 02 14:04:57 2010 +0100
@@ -3,7 +3,7 @@
     MoinMoin - Package Installer
 
     @copyright: 2005 MoinMoin:AlexanderSchremmer,
-                2007 MoinMoin:ReimarBauer
+                2007-2010 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -414,7 +414,12 @@
             if fnname == '':
                 continue
             try:
-                fn = getattr(self, "do_" + fnname)
+                if fnname in self.request.cfg.packagepages_actions_excluded:
+                    self.msg += u"action package %s: excluded \n" % elements[0].strip()
+                    success = False
+                    continue
+                else:
+                    fn = getattr(self, "do_" + fnname)
             except AttributeError:
                 self.msg += u"Exception RuntimeScriptException: %s\n" % (
                         _("Unknown function %(func)s in line %(lineno)i.") %
--- a/MoinMoin/wikiutil.py	Tue Feb 02 14:01:55 2010 +0100
+++ b/MoinMoin/wikiutil.py	Tue Feb 02 14:04:57 2010 +0100
@@ -2452,7 +2452,7 @@
     digest = sha.new(request.cfg.secrets)
     digest.update(ticket)
 
-    if request.session:
+    if request.session and not request.session.is_new:
         sid = request.session.name
     else:
         sid = 'None'