Skip to content

Commit cad0d75

Browse files
authored
Merge pull request #1682 from RogerHaase/1578-examples
readthedocs does not provide access to /docs/examples/*; fixes #1578
2 parents 41267f8 + aee6e5c commit cad0d75

File tree

20 files changed

+37
-31
lines changed

20 files changed

+37
-31
lines changed

docs/admin/backup.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Selective Backup
1616
================
1717
If you want a backup of MoinMoin and your data, then backup the following:
1818

19-
* your data
19+
* your data, ususlly everything under wiki/
2020
* moin configuration, e.g. wikiconfig.py
2121
* logging configuration, e.g. logging.conf
2222
* moin deployment script, e.g. moin.wsgi

docs/admin/configure.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,8 @@ username (like with german umlauts or accented characters). If moin does not
564564
crash (log a Unicode Error), you have likely found the correct coding.
565565

566566
For users configuring GivenAuth on Apache, an example virtual host configuration
567-
file is included with MoinMoin in `docs/examples/deployment/moin-http-basic-auth.conf`.
567+
is included at `/contrib/deployment/moin-http-basic-auth.conf`
568+
568569

569570
LDAPAuth
570571
--------
@@ -1517,7 +1518,7 @@ the following::
15171518
email_tracebacks = True
15181519

15191520

1520-
Please also check the logging configuration example in `docs/examples/config/logging/email`.
1521+
Please also check the logging configuration example in `/contrib/logging/email`.
15211522

15221523
User E-Mail Address Verification
15231524
--------------------------------
@@ -1570,13 +1571,13 @@ https://docs.python.org/3/library/logging.config.html#configuration-file-format
15701571

15711572

15721573
There are also some logging configurations in the
1573-
`docs/examples/config/logging/` directory.
1574+
`contrib/logging/` directory.
15741575

15751576
Logging configuration needs to be done very early, usually it will be done
15761577
from your adaptor script, e.g. moin.wsgi::
15771578

15781579
from moin import log
1579-
log.load_config('wiki/config/logging/logfile')
1580+
log.load_config('contrib/logging/logfile')
15801581

15811582
You have to fix that path to use a logging configuration matching your
15821583
needs (use an absolute path).

docs/admin/password-reset.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Note: if we say "reset a password" (to use a commonly used term), we mean to
1818
"invalidate the password hash" (so that no password exists that validates
1919
against that hash). MoinMoin does not keep user passwords in cleartext.
2020

21-
The files we refer to below are located in docs/examples/password-reset/...
21+
The files we refer to below are located in contrib/password-reset/...
2222

2323

2424
Resetting one or few password(s)

docs/admin/serve.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ because you can't import the application from MoinMoin.
8686
Continue reading here: https://flask.palletsprojects.com/deploying/
8787

8888
In case you run into trouble with deployment of the moin WSGI application,
89-
you can try a simpler WSGI app first. See `docs/examples/deployment/test.wsgi`.
89+
you can try a simpler WSGI app first. An example file is included at
90+
`/contrib/deployment/test.wsgi`.
9091

9192
As long as you can't make `test.wsgi` work, the problem is not with
9293
moin, but rather with your web server and WSGI app deployment method.

src/moin/cli/migration/moin19/import19.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def migr_logging(msg_id, log_msg):
9595
"""
9696
The logging function writes the first messages of each type
9797
with warning level and the rest with debug level only.
98-
See docs/examples/config/logging/logfile_cli for logging configuration example
98+
See contrib/logging/logfile_cli for logging configuration example
9999
"""
100100
migr_stat[msg_id] += 1
101101
if migr_stat[msg_id] < migr_warn_max:
File renamed without changes.
Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
"""
1212

1313
# hint: use None as value if the code already is in sys.path
14-
moin_code = None # '/path/to/code'
14+
moin_code = None # '/path/to/code'
1515

16-
wiki_config = '/path/to/config/wikiconfig.py'
16+
wiki_config = "/path/to/config/wikiconfig.py"
1717

1818
import sys, os
1919

@@ -23,12 +23,14 @@ if moin_code:
2323
sys.path.insert(0, moin_code)
2424

2525
## this works around a bug in flup's CGI autodetection (as of flup 1.0.1):
26-
#os.environ['FCGI_FORCE_CGI'] = 'Y' # 'Y' for (slow) CGI, 'N' for FCGI
26+
# os.environ['FCGI_FORCE_CGI'] = 'Y' # 'Y' for (slow) CGI, 'N' for FCGI
2727

2828
# Creating the Moin (Flask) WSGI application
2929
from moin.app import create_app
30+
3031
application = create_app(wiki_config)
3132

33+
3234
class FixScriptName(object):
3335
"""This middleware fixes the script_name."""
3436

@@ -37,7 +39,7 @@ class FixScriptName(object):
3739
self.script_name = script_name
3840

3941
def __call__(self, environ, start_response):
40-
environ['SCRIPT_NAME'] = self.script_name
42+
environ["SCRIPT_NAME"] = self.script_name
4143
return self.app(environ, start_response)
4244

4345

@@ -55,15 +57,16 @@ fix_apache_win32 = False # <-- adapt here as needed
5557

5658
if fix_apache_win32:
5759
from werkzeug.contrib.fixers import PathInfoFromRequestUriFix
60+
5861
application.wsgi_app = PathInfoFromRequestUriFix(application.wsgi_app)
5962

6063
# there are also some more fixers in werkzeug.contrib.fixers - see there
6164
# if the stuff above is not enough for your setup.
6265

6366
## Choose your server mode (threaded, forking or single-thread)
6467
from flup.server.fcgi import WSGIServer
65-
#from flup.server.fcgi_fork import WSGIServer
66-
#from flup.server.fcgi_single import WSGIServer
6768

68-
WSGIServer(application).run()
69+
# from flup.server.fcgi_fork import WSGIServer
70+
# from flup.server.fcgi_single import WSGIServer
6971

72+
WSGIServer(application).run()
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
"""
1919

2020
# hint: use None as value if the code already is in sys.path
21-
moin_code = None # '/path/to/code'
21+
moin_code = None # '/path/to/code'
2222

23-
wiki_config = '/path/to/config/wikiconfig.py'
23+
wiki_config = "/path/to/config/wikiconfig.py"
2424

2525
import sys, os
2626

@@ -31,8 +31,8 @@ if moin_code:
3131

3232
# application is the Flask application
3333
from moin.app import create_app
34+
3435
application = create_app(wiki_config)
3536

3637
# please note: if you want to do some wsgi app wrapping, do it like shown below:
37-
#application.wsgi_app = somewrapper(application.wsgi_app)
38-
38+
# application.wsgi_app = somewrapper(application.wsgi_app)
Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import sys
4141
try:
4242
__file__
4343
except NameError:
44-
__file__ = '?'
44+
__file__ = "?"
4545

4646
html_template = """\
4747
<html>
@@ -68,31 +68,32 @@ row_template = " <tr><td>%s</td><td>%r</td></tr>"
6868

6969

7070
def application(environ, start_response):
71-
""" The WSGI test application """
71+
"""The WSGI test application"""
7272
# emit status / headers
7373
status = "200 OK"
74-
headers = [('Content-Type', 'text/html'), ]
74+
headers = [("Content-Type", "text/html")]
7575
start_response(status, headers)
7676

7777
# assemble and return content
7878
content = html_template % {
79-
'python_version': sys.version,
80-
'platform': sys.platform,
81-
'abs_path': os.path.abspath('.'),
82-
'filename': __file__,
83-
'python_path': repr(sys.path),
84-
'wsgi_env': '\n'.join([row_template % item for item in environ.items()]),
79+
"python_version": sys.version,
80+
"platform": sys.platform,
81+
"abs_path": os.path.abspath("."),
82+
"filename": __file__,
83+
"python_path": repr(sys.path),
84+
"wsgi_env": "\n".join([row_template % item for item in environ.items()]),
8585
}
8686
return [content.encode()]
8787

8888

89-
if __name__ == '__main__':
89+
if __name__ == "__main__":
9090
# this runs when script is started directly from commandline
9191
try:
9292
# create a simple WSGI server and run the application
9393
from wsgiref import simple_server
94+
9495
print("Running test application - point your browser at http://localhost:8080/ ...")
95-
httpd = simple_server.WSGIServer(('', 8080), simple_server.WSGIRequestHandler)
96+
httpd = simple_server.WSGIServer(("", 8080), simple_server.WSGIRequestHandler)
9697
httpd.set_app(application)
9798
httpd.serve_forever()
9899
except ImportError:

0 commit comments

Comments
 (0)