Skip to content

Commit

Permalink
Merge pull request #1639 from UlrichB22/quickinst
Browse files Browse the repository at this point in the history
Remove index and run subcommand from quickinstall.py and docs
  • Loading branch information
RogerHaase authored Mar 9, 2024
2 parents 1847c89 + a303ecd commit 98ef7e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 49 deletions.
12 changes: 5 additions & 7 deletions docs/admin/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ Activate the virtual environment::
Typing "./m" (or "m" on Windows) will display a menu similar to:

::

usage: "./m <target>" where <target> is:
Usage: "./m <target>" where <target> is:

quickinstall update virtual environment with required packages
extras install packages required for docs and moin development
Expand All @@ -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)
Expand All @@ -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.:

Expand All @@ -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
Expand Down
6 changes: 4 additions & 2 deletions docs/admin/serve.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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!

Expand Down
4 changes: 2 additions & 2 deletions docs/devel/development.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 4 additions & 38 deletions quickinstall.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -96,13 +95,11 @@
'dump-html': DUMPHTML,
'extras': EXTRAS,
'dist': DIST,
'index': INDEX,
}


help = """
usage: "{0} <target>" where <target> is:
Usage: "{0} <target>" where <target> is:
quickinstall update virtual environment with required packages
extras install packages required for docs and moin development
Expand All @@ -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)
Expand All @@ -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)


Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 98ef7e7

Please sign in to comment.