Skip to content

Commit 64e3c02

Browse files
committed
Doc restrict modes
1 parent adbb971 commit 64e3c02

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

‎docs/how-to/wheel.rst‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ But pyarmor doesn't allow to change obfuscated scripts by default, it need disab
114114
$ pyarmor cfg -p parent.child.__init__ restrict_module = 0
115115
$ pyarmor gen --recursive -i src/parent
116116
117-
The option :option:`pyarmor cfg -p` ``parent.child.__init__`` lets pyarmor disable this restriction for ``parent/child/__init__.py``.
117+
The option :option:`pyarmor cfg -p` ``parent.child.__init__`` lets pyarmor disable this restriction only for ``parent/child/__init__.py``.
118118
119119
Now patch ``dist/parent/child/__init__.py`` and rebuild wheel::
120120

‎docs/topic/obfuscated-script.rst‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,25 @@ User also could store any private data in the runtime key, then use :term:`hook
5353

5454
If runtime key is stored in an outer file, any readable text in the header will be ignored. User can add comment at the header of runtime key file, the rest part are bytes data, only in the obfuscated scripts they could be read.
5555

56+
.. _restrict modes:
57+
58+
Restrict modes
59+
==============
60+
61+
By default the obfuscated scripts can't be changed.
62+
63+
After using :option:`--private`, the obfuscated scripts could not be imported by plain script or Python interpreter.
64+
65+
After using :option:`--restrict`, other plain scripts could not call any method in the obfuscated modules.
66+
67+
Disable all the restrictions by this command::
68+
69+
$ pyarmor cfg restrict_module 0
70+
71+
Generally only disable all the restrictions for specified module. For example, only no restrictions for module ``NAME``::
72+
73+
$ pyarmor cfg -p NAME restrict_module 0
74+
5675
.. _the differences of obfuscated scripts:
5776

5877
The differences of obfuscated scripts

0 commit comments

Comments
 (0)