moin-2.0 /

# Copyright: 2013 MoinMoin:BastianBlank
# License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
create a virtual environment and install moin2 (in development mode) and
its requirements.

needs: virtualenv, pip

import MoinMoin  # validate python version
import argparse
import logging
import os.path
import subprocess
import sys
import virtualenv

class QuickInstall(object):
    def __init__(self, source, venv=None):
        self.dir_source = source
        if not venv:
            base, source_name = os.path.split(source)
            venv = os.path.join(base, 'venv-{}-{}'.format(source_name, os.path.basename(sys.executable)))

        venv_home, venv_lib, venv_inc, venv_bin = virtualenv.path_locations(venv)
        self.dir_venv = venv_home
        self.dir_venv_bin = venv_bin

    def __call__(self):

Succesfully created or updated venv
You can run MoinMoin as
""".format(self.dir_venv, os.path.join(self.dir_venv_bin, 'moin')))

    def do_venv(self):

    def do_install(self):
            os.path.join(self.dir_venv_bin, 'pip'),
            # XXX: move cache to XDG cache dir
            os.path.join(os.path.dirname(self.dir_venv), '.pip-download-cache'),

    def do_catalog(self):
            os.path.join(self.dir_venv_bin, 'python'),
            os.path.join(self.dir_source, ''),
            'compile_catalog', '--statistics',
            # needed in case user runs with a cwd other than the repo root
            '--directory', os.path.join(os.path.dirname(__file__), 'MoinMoin', 'translations'),

if __name__ == '__main__':

    parser = argparse.ArgumentParser()
    parser.add_argument('venv', metavar='VENV', nargs='?', help='location of v(irtual)env')
    args = parser.parse_args()

    QuickInstall(os.path.dirname(os.path.realpath(sys.argv[0])), venv=args.venv)()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.