changeset 4721:56548b251138

packages: do_copythemefile copies now theme files to MoinMoin/web/static/htdocs if write rights are given. This lifts the restriction of using this method only with the standalone server.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 03 May 2009 19:46:48 +0200
parents 9a26c69ccf5a
children d87cf99cd525
files MoinMoin/packages.py
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/packages.py	Fri May 01 21:36:12 2009 +0200
+++ b/MoinMoin/packages.py	Sun May 03 19:46:48 2009 +0200
@@ -3,7 +3,7 @@
     MoinMoin - Package Installer
 
     @copyright: 2005 MoinMoin:AlexanderSchremmer,
-                2007 MoinMoin:ReimarBauer
+                2007-2009 MoinMoin:ReimarBauer
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -227,11 +227,11 @@
         _ = self.request.getText
         if self.themename is None:
             raise RuntimeScriptException(_("The theme name is not set."))
-        sa = getattr(self.request, "sareq", None)
-        if sa is None:
-            raise RuntimeScriptException(_("Installing theme files is only supported "
-                                           "for standalone type servers."))
-        htdocs_dir = sa.server.htdocs
+
+        from MoinMoin.web.static import STATIC_FILES_PATH as htdocs_dir
+        if not os.access(htdocs_dir, os.W_OK):
+            raise RuntimeScriptException(_("Theme files not installed! Write rights missing for %s.") % htdocs_dir)
+
         theme_file = os.path.join(htdocs_dir, self.themename,
                                   wikiutil.taintfilename(ftype),
                                   wikiutil.taintfilename(target))