-
Couldn't load subscription status.
- Fork 42
More docs #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More docs #37
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for writing documentation! 👍
README.rst
Outdated
|
|
||
| RestrictedPython is a defined subset of the Python language which allows to provide a program input into a trusted environment. | ||
|
|
||
| For full documentation please see docs/index. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put the documentation on ReadTheDocs: http://restrictedpython.readthedocs.io/en/python3_update/
Please use this link to point to the full documentation.
docs/contributing/index.rst
Outdated
| * `Trello Board`_ | ||
|
|
||
|
|
||
| .. _`Trello Board`: https://trello.com/b/pKaXJIlT/restrictedpython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the link to the Trello board as it is not public and not in English. Instead you may refer to the issue tracker here on GitHub.
docs/roadmap/index.rst
Outdated
|
|
||
| A few of the action items currently worked on is on our `Trello Board`_. | ||
|
|
||
| .. _`Trello Board`: https://trello.com/b/pKaXJIlT/restrictedpython |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dito
docs/usage/basic_usage.rst
Outdated
|
|
||
| .. code:: Python | ||
| from RestrictedPython import compile_restricted as compile |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the as compile, see next comment why.
docs/usage/basic_usage.rst
Outdated
| pass | ||
| """ | ||
| byte_code = compile(source_code, filename='<inline code>', mode='exec') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using compile_restricted here instead of compile shows the difference. And allows easier to understand text in the next paragraph.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dismiss as github did not see change from compile to compile_restricted
docs/usage/policy.rst
Outdated
|
|
||
|
|
||
|
|
||
| Also RestrictedPython provides a way to define Policies, by redefining restricted versions of ``print``, ``getattr``, ``setattr``, ``import``, etc.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Also/
docs/usage/policy.rst
Outdated
|
|
||
|
|
||
| Also RestrictedPython provides a way to define Policies, by redefining restricted versions of ``print``, ``getattr``, ``setattr``, ``import``, etc.. | ||
| As shortcutes it offers three stripped down versions of Pythons ``__builtins__``: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/shortcutes/shortcuts
docs/usage/policy.rst
Outdated
|
|
||
| * ``safe_builtins`` (by Guards.py) | ||
| * ``limited_builtins`` (by Limits.py), which provides restriced sequence types | ||
| * ``utilities_builtins`` (by Utilities.py), which provides access for standard modules math, random, string and for sets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They should be importable from RestrictedPython I see no need to name the modules they reside in.
docs/usage/policy.rst
Outdated
| * ``limited_builtins`` (by Limits.py), which provides restriced sequence types | ||
| * ``utilities_builtins`` (by Utilities.py), which provides access for standard modules math, random, string and for sets. | ||
|
|
||
| There is also a guard function for making attributes immutable --> ``full_write_guard`` (write and delete protected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct, the full_write_guard requires special __guarded_*__ for write and delete.
setup.py
Outdated
| read('CHANGES.rst')), | ||
| long_description=(read('README.rst') + '\n' + | ||
| read('docs', 'install', 'index.rst') + '\n' + | ||
| read('docs', 'usage', 'basic_usage.rst') + '\n' + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If README.rst contains the link to ReadTheDocs these two lines would not be necessary.
BTW they do not contain valid ReST PyPI can understand:
(ERROR/3) Unknown interpreted text role "py:func".
|
All requested changes applied, but one is not registed by github tool, please new review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM besides some cosmetical change requests.
docs/usage/framework_usage.rst
Outdated
| mode='exec', | ||
| policy=policy # Policy Class | ||
| ) | ||
| # exec(byte_code, { ... }, { ... }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line could be removed.
| byte_code = compile_restricted(source_code, | ||
| filename='<inline code>', | ||
| mode='exec', | ||
| policy=policy # Policy Class |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In L46 you call the instance policy_instance instead of policy.
docs/usage/policy.rst
Outdated
| * ``utilities_builtins`` (by Utilities.py), which provides access for standard modules math, random, string and for sets. | ||
| Describe Guards and predefined guard methods in details | ||
|
|
||
| There is also a guard function for making attributes immutable --> ``full_write_guard`` (write and delete protected) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think this is correct, the full_write_guard requires special __guarded_*__ methods for write and delete.
|
@icemac fixed, please new review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Thank you four your hard work and your patience with my change requests.
No description provided.