-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
137 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,49 @@ | ||
{{ fullname | escape | underline }} | ||
|
||
.. | ||
Custom formatting of module doc layout | ||
https://stackoverflow.com/questions/48074094/use-sphinx-autosummary-recursively-to-generate-api-documentation | ||
TODO: how can we add the documented module attribuets (constants, ...)? | ||
.. rubric:: Description | ||
|
||
.. automodule:: {{ fullname }} | ||
|
||
.. currentmodule:: {{ fullname }} | ||
|
||
|
||
{% if classes %} | ||
.. rubric:: Classes | ||
|
||
.. autosummary:: | ||
:toctree: . | ||
|
||
{% for class in classes %} | ||
{{ class }} | ||
{% for item in classes %} | ||
{{ item }} | ||
{% endfor %} | ||
|
||
{% endif %} | ||
|
||
|
||
{% if functions %} | ||
.. rubric:: Functions | ||
|
||
.. autosummary:: | ||
:toctree: . | ||
{% for function in functions %} | ||
{{ function }} | ||
{% for item in functions %} | ||
{{ item }} | ||
{% endfor %} | ||
|
||
{% endif %} | ||
|
||
|
||
{% if exceptions %} | ||
.. rubric:: Exceptions | ||
|
||
.. autosummary:: | ||
:toctree: . | ||
{% for item in exceptions %} | ||
{{ item }} | ||
{% endfor %} | ||
|
||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,60 @@ | ||
import logging | ||
|
||
# _logger = logging.getLogger("wsgidav") | ||
_logger = logging.getLogger(__name__) | ||
logger = logging.getLogger("wsgidav") | ||
|
||
# _logger = logging.getLogger(__name__) | ||
|
||
# logging.basicConfig(level=logging.DEBUG, | ||
# format='%(asctime)s %(name)-15s %(levelname)-8s %(message)s', | ||
# # datefmt='%Y-%m-%d %H:%M:%S', | ||
# ) | ||
|
||
_logger.addHandler(logging.NullHandler()) | ||
_logger2 = logging.getLogger("wsgidav.server") | ||
|
||
|
||
def test_logger(logger, msg=""): | ||
logger.debug("Debug {}".format(msg)) | ||
logger.info("Info {}".format(msg)) | ||
logger.warn("Warn {}".format(msg)) | ||
logger.error("Error {}".format(msg)) | ||
|
||
|
||
def setLogger(): | ||
pass | ||
|
||
test_logger(_logger, "1") | ||
test_logger(_logger2, "2") | ||
|
||
_logger.setLevel(logging.WARN) | ||
test_logger(_logger, "1w") | ||
test_logger(_logger2, "2w") | ||
|
||
# _logger.addHandler(logging.NullHandler()) | ||
# _logger2 = logging.getLogger("wsgidav.server") | ||
# | ||
# | ||
# def test_logger(logger, msg=""): | ||
# logger.debug("Debug {}".format(msg)) | ||
# logger.info("Info {}".format(msg)) | ||
# logger.warn("Warn {}".format(msg)) | ||
# logger.error("Error {}".format(msg)) | ||
# | ||
# | ||
# def setLogger(): | ||
# pass | ||
# | ||
# test_logger(_logger, "1") | ||
# test_logger(_logger2, "2") | ||
# | ||
# _logger.setLevel(logging.WARN) | ||
# test_logger(_logger, "1w") | ||
# test_logger(_logger2, "2w") | ||
|
||
import sys | ||
from cheroot import wsgi | ||
|
||
from wsgidav.wsgidav_app import DEFAULT_CONFIG, WsgiDAVApp | ||
from wsgidav.fs_dav_provider import FilesystemProvider | ||
|
||
provider = FilesystemProvider("/Users/martin/pub") | ||
config = DEFAULT_CONFIG.copy() | ||
config.update({ | ||
"host": "0.0.0.0", | ||
"port": 8080, | ||
# "mount_path": "/dav", | ||
"provider_mapping": {"/": provider}, | ||
"verbose": 3, | ||
}) | ||
|
||
app = WsgiDAVApp(config) | ||
|
||
server_args = { | ||
"bind_addr": (config["host"], config["port"]), | ||
"wsgi_app": app, | ||
} | ||
server = wsgi.Server(**server_args) | ||
try: | ||
server.start() | ||
except KeyboardInterrupt: | ||
print("END?") | ||
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.