From a303ecd295b72348a2073d2ee5f502d0dea68379 Mon Sep 17 00:00:00 2001 From: UlrichB22 <97119703+UlrichB22@users.noreply.github.com> Date: Thu, 7 Mar 2024 23:24:07 +0100 Subject: [PATCH] Remove index and run subcommand from quickinstall.py and docs --- docs/admin/install.rst | 12 +++++------ docs/admin/serve.rst | 6 ++++-- docs/devel/development.rst | 4 ++-- quickinstall.py | 42 ++++---------------------------------- 4 files changed, 15 insertions(+), 49 deletions(-) diff --git a/docs/admin/install.rst b/docs/admin/install.rst index e17f6f4fa..34acfaa4e 100644 --- a/docs/admin/install.rst +++ b/docs/admin/install.rst @@ -183,8 +183,7 @@ Activate the virtual environment:: Typing "./m" (or "m" on Windows) will display a menu similar to: :: - - usage: "./m " where is: + Usage: "./m " where is: quickinstall update virtual environment with required packages extras install packages required for docs and moin development @@ -196,10 +195,8 @@ Typing "./m" (or "m" on Windows) will display a menu similar to: sample create wiki and load sample data restore * create wiki and restore wiki/backup.moin *option, specify file - run * run built-in wiki server *options (--port 8081) backup * roll 3 prior backups and create new backup *option, specify file dump-html * create a static HTML image of wiki *options, see docs - index delete and rebuild indexes css run lessc to update basic theme CSS files tests * run tests, log output (-v -k my_test) @@ -211,6 +208,8 @@ Typing "./m" (or "m" on Windows) will display a menu similar to: del-rej delete all files matching *.rej del-wiki create a backup, then delete all wiki data + Please refer to 'moin help' to learn more about the CLI for wiki administrators. + While most of the above menu choices may be executed now, new users should do the following to create a wiki instance and load it with sample data.: @@ -230,11 +229,10 @@ Next, run the built-in wiki server: :: - m run # in Windows - ./m run # in Unix or Linux + moin run As the server starts, a few log messages will be output to the -terminal window. Point your browser to http://127.0.0.1:8080, the +terminal window. Point your browser to http://127.0.0.1:5000, the sample Home page will appear and more log messages will be output to the terminal window. Do a quick test by accessing some of the demo items and do a modify and save. If all goes well, your installation diff --git a/docs/admin/serve.rst b/docs/admin/serve.rst index 94db0c800..c1f90b1c5 100644 --- a/docs/admin/serve.rst +++ b/docs/admin/serve.rst @@ -9,7 +9,7 @@ is suitable for development, debugging, and personal and small group wikis. It is *not* made for serving bigger loads, but it is easy to use. -Please note that by default the built-in server uses port 8080. As this is +Please note that by default the built-in server uses port 5000. As this is above port 1024, root (Administrator) privileges are not required and we strongly recommend that you use a normal, unprivileged user account instead. If you are running a desktop wiki or doing moin development, then use your normal @@ -28,7 +28,9 @@ Run the moin built-in server as follows:: While the moin server is starting up, you will see some log output, for example:: - 2016-01-11 13:30:05,394 INFO werkzeug:87 * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit) + INFO werkzeug WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. + * Running on http://127.0.0.1:5000 + INFO werkzeug Press CTRL+C to quit Now point your browser at that URL - your moin wiki is running! diff --git a/docs/devel/development.rst b/docs/devel/development.rst index 89a38365b..e8f9a2c41 100644 --- a/docs/devel/development.rst +++ b/docs/devel/development.rst @@ -69,8 +69,8 @@ create your development environment ./m sample # Windows: m sample * start the built-in server:: - ./m run # Windows: m run -* point your browser at http://127.0.0.1:8080/ to access your development wiki + moin run +* point your browser at http://127.0.0.1:5000/ to access your development wiki * key ctrl+C to stop the built-in server add more tools, exercise tools diff --git a/quickinstall.py b/quickinstall.py index f08a8d8b0..290052513 100755 --- a/quickinstall.py +++ b/quickinstall.py @@ -65,7 +65,6 @@ DUMPHTML = 'm-dump-html.txt' EXTRAS = 'm-extras.txt' DIST = 'm-create-dist.txt' -INDEX = 'm-rebuild-index.txt' # default files used for backup and restore BACKUP_FILENAME = os.path.normpath('wiki/backup.moin') SAMPLE_FILENAME = 'src/moin/contrib/sample-backup.moin' @@ -96,13 +95,11 @@ 'dump-html': DUMPHTML, 'extras': EXTRAS, 'dist': DIST, - 'index': INDEX, } help = """ - -usage: "{0} " where is: +Usage: "{0} " where is: quickinstall update virtual environment with required packages extras install packages required for docs and moin development @@ -114,10 +111,8 @@ sample create wiki and load sample data restore * create wiki and restore wiki/backup.moin *option, specify file -run * run built-in wiki server *options (--port 8081) backup * roll 3 prior backups and create new backup *option, specify file dump-html * create a static HTML image of wiki *options, see docs -index delete and rebuild indexes css run lessc to update basic theme CSS files tests * run tests, log output (-v -k my_test) @@ -128,6 +123,8 @@ del-pyc delete all files matching *.pyc del-rej delete all files matching *.rej del-wiki create a backup, then delete all wiki data + +Please refer to 'moin help' to learn more about the CLI for wiki administrators. """.format(M) @@ -151,7 +148,6 @@ def search_for_phrase(filename): DIST: ('creating', 'copying', 'adding', 'hard linking', ), DOCS: ('build finished', 'build succeeded', 'traceback', 'failed', 'error', 'usage', 'importerror', 'exception occurred', ), - INDEX: ('error', 'fail', 'timeout', 'traceback', 'success', ), } ignore_phrases = {TOX: ('interpreternotfound', )} # for these file names, display a count of occurrances rather than each found line @@ -200,11 +196,11 @@ def make_wiki(command, mode='w', msg='\nSuccess: a new wiki has been created.'): if wiki_exists() and mode == 'w': print('Error: a wiki exists, delete it and try again.') else: + copy_config_files() print('Output messages redirected to {0}.'.format(NEWWIKI)) with open(NEWWIKI, mode) as messages: result = subprocess.call(command, shell=True, stderr=messages, stdout=messages) if result == 0: - copy_config_files() print(msg) return True else: @@ -367,36 +363,6 @@ def cmd_import19(self, *args): """import a moin 1.9 wiki""" print("Error: Subcommand import19 not supported. Please use 'moin import19'.") - def cmd_index(self, *args): - """delete and rebuild index""" - if wiki_exists(): - command = 'moin index-create{0} moin index-build'.format(SEP) - print('Rebuilding indexes...') - try: - with open(INDEX, 'w') as messages: - subprocess.call(command, shell=True, stderr=messages, stdout=messages) - print('\nImportant messages from {0} are shown below. Do "{1} log index" to see complete log.'.format( - INDEX, M)) - search_for_phrase(INDEX) - except KeyboardInterrupt: - pass # eliminates traceback on windows - else: - print('Error: a wiki must be created before rebuilding the indexes.') - self.run_time('Rebuild index') - - def cmd_run(self, *args): - """run built-in wiki server""" - if wiki_exists(): - if WINDOWS_OS: - args += ('--with-threads', ) - command = 'moin run {0}'.format(' '.join(args)) - try: - subprocess.call(command, shell=True) - except KeyboardInterrupt: - pass # eliminates traceback on windows - else: - print('Error: a wiki must be created before running the built-in server.') - def cmd_backup(self, *args): """roll 3 prior backups and create new wiki/backup.moin or backup to user specified file""" if wiki_exists():