Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pull in the documentation branch with Sphinx docs for the begins project.
- Loading branch information
Showing
9 changed files
with
1,176 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{% extends "!layout.html" %} | ||
{% block sidebartoc %} | ||
<h3>{{ _('Table Of Contents') }}</h3> | ||
{{ toctree(includehidden=True) }} | ||
{% endblock %} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
============== | ||
The begins API | ||
============== | ||
|
||
.. automodule:: begin | ||
:members: | ||
:undoc-members: | ||
|
||
Utilities | ||
========= | ||
|
||
.. automodule:: begin.utils | ||
:members: | ||
:undoc-members: | ||
|
||
Help Formatters | ||
=============== | ||
|
||
.. automodule:: begin.formatters | ||
:members: | ||
:undoc-members: |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import begin | ||
import logging | ||
|
||
@begin.subcommand | ||
def hello(name): | ||
"Say hello" | ||
logging.info("Hello {0}".format(name)) | ||
|
||
@begin.subcommand | ||
def goodbye(name): | ||
"Say goodbye" | ||
logging.info("Goodbye {0}".format(name)) | ||
|
||
@begin.start | ||
@begin.logging | ||
def main(): | ||
"Greetings and salutations" |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import begin | ||
my_formatter = begin.formatters.compose(begin.formatters.RawDescription) | ||
|
||
@begin.subcommand | ||
def sub(): | ||
"""Such text | ||
Very whitespace | ||
So exact | ||
""" | ||
|
||
@begin.start(formatter_class=my_formatter) | ||
def main(): | ||
"""Plain text formatting for this help: | ||
- how does it look? | ||
Params: | ||
foo is yummy... | ||
""" |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import shutil | ||
import begin | ||
|
||
begin.subcommand(shutil.copy) | ||
begin.subcommand(shutil.copy2) | ||
begin.subcommand(shutil.copyfile) | ||
begin.subcommand(shutil.copymode) | ||
begin.subcommand(shutil.copystat) | ||
begin.subcommand(shutil.copytree) | ||
begin.subcommand(shutil.move) | ||
begin.subcommand(shutil.rmtree) | ||
|
||
# Patch in doc before the func is wrapped by begin.start | ||
def patch_doc(doc): | ||
def decorate(func): | ||
func.__doc__ = doc | ||
return func | ||
return decorate | ||
|
||
@begin.start | ||
@patch_doc(shutil.__doc__) | ||
def main(): | ||
pass |
Oops, something went wrong.