moinsetup

Changeset

35:8f19409f081a
2011-05-28 Paul Boddie raw files shortlog changelog graph Added a parser installation action. Added support for attachments in the page-packaging action. Added some release notes.
README.txt (file) moinsetup.py (file)
     1.1 --- a/README.txt	Fri Apr 15 23:08:37 2011 +0200
     1.2 +++ b/README.txt	Sat May 28 21:42:15 2011 +0200
     1.3 @@ -136,6 +136,20 @@
     1.4  CMDsyntax                   Tested with 0.91
     1.5                              Source: http://www.boddie.org.uk/david/Projects/Python/CMDSyntax/index.html
     1.6  
     1.7 +New in moinsetup 0.2 (Changes since moinsetup 0.1)
     1.8 +--------------------------------------------------
     1.9 +
    1.10 +  * Improved OpenID configuration, supporting MoinMoin 1.9, and added support
    1.11 +    for other authentication methods.
    1.12 +  * Added support for ACL-capable filesystems when setting Wiki permissions.
    1.13 +    It can be more convenient to retain read/write access to the installed
    1.14 +    files while also granting the Web server user (who need not be in a common
    1.15 +    group) access to read and modify the files.
    1.16 +  * Added support for configurations employing a separate static resources
    1.17 +    directory (such as a typical "htdocs" directory).
    1.18 +  * Added a parser installation action.
    1.19 +  * Added support for page attachments in the page-packaging action.
    1.20 +
    1.21  Release Procedures
    1.22  ------------------
    1.23  
     2.1 --- a/moinsetup.py	Fri Apr 15 23:08:37 2011 +0200
     2.2 +++ b/moinsetup.py	Sat May 28 21:42:15 2011 +0200
     2.3 @@ -301,6 +301,7 @@
     2.4          "install_plugins",
     2.5          "install_actions",
     2.6          "install_macros",
     2.7 +        "install_parsers",
     2.8          "install_theme_resources",
     2.9          "edit_theme_stylesheet",
    2.10  
    2.11 @@ -981,6 +982,12 @@
    2.12  
    2.13          self.install_plugins(macros_dir, "macro")
    2.14  
    2.15 +    def install_parsers(self, parsers_dir):
    2.16 +
    2.17 +        "Install Wiki macros provided in the given 'parsers_dir'."
    2.18 +
    2.19 +        self.install_plugins(parsers_dir, "parser")
    2.20 +
    2.21      def install_theme_resources(self, theme_resources_dir, theme_name=None):
    2.22  
    2.23          """
    2.24 @@ -1101,8 +1108,26 @@
    2.25              script = ["MoinMoinPackage|1"]
    2.26  
    2.27              for filename in os.listdir(page_directory):
    2.28 -                package.write(join(page_directory, filename), filename)
    2.29 -                script.append("AddRevision|%s|%s" % (filename, filename))
    2.30 +                pathname = join(page_directory, filename)
    2.31 +
    2.32 +                # Add files as pages having the filename as page name.
    2.33 +
    2.34 +                if os.path.isfile(pathname):
    2.35 +                    package.write(pathname, filename)
    2.36 +                    script.append("AddRevision|%s|%s" % (filename, filename))
    2.37 +
    2.38 +                # Add directories ending with "-attachments" as collections of
    2.39 +                # attachments for a particular page.
    2.40 +
    2.41 +                elif os.path.isdir(pathname) and filename.endswith("-attachments"):
    2.42 +                    parent = filename[:-len("-attachments")]
    2.43 +
    2.44 +                    # Add each file as an attachment.
    2.45 +
    2.46 +                    for attachment in os.listdir(pathname):
    2.47 +                        zipname = "%s_%s" % (filename, attachment)
    2.48 +                        package.write(join(pathname, attachment), zipname)
    2.49 +                        script.append("AddAttachment|%s|%s|%s||" % (zipname, attachment, parent))
    2.50  
    2.51              package.writestr("MOIN_PACKAGE", "\n".join(script))
    2.52