Skip to content

Commit 64a4c71

Browse files
committed
Refactor disable-restrict-mode
1 parent faf0b38 commit 64a4c71

8 files changed

Lines changed: 14 additions & 16 deletions

File tree

src/examples/build-for-exe.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ cd /D %PROJECT%
9494

9595
REM This is the key, change default runtime path, otherwise dynamic library _pytransform could not be found
9696
Echo.
97-
Call pyarmor.bat config --runtime-path="" --disable-restrict-mode=1 --manifest "global-include *.py, exclude %ENTRY_SCRIPT% setup.py pytransform.py, prune build, prune dist"
97+
Call pyarmor.bat config --runtime-path="" --manifest "global-include *.py, exclude %ENTRY_SCRIPT% setup.py pytransform.py, prune build, prune dist"
9898

9999
REM Obfuscate scripts without runtime files, only obfuscated scripts are generated
100100
Echo.

src/examples/build-for-freeze.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ cd /D %PROJECT%
9393

9494
REM This is the key, change default runtime path, otherwise dynamic library _pytransform could not be found
9595
Echo.
96-
Call pyarmor.bat config --runtime-path="" --disable-restrict-mode=1 --manifest "global-include *.py, exclude %ENTRY_SCRIPT% setup.py pytransform.py, prune build, prune dist"
96+
Call pyarmor.bat config --runtime-path="" --manifest "global-include *.py, exclude %ENTRY_SCRIPT% setup.py pytransform.py, prune build, prune dist"
9797

9898
REM Obfuscate scripts without runtime files, only obfuscated scripts are generated
9999
Echo.
@@ -116,7 +116,7 @@ Echo.
116116
SetLocal
117117
Cd /D %SOURCE%
118118
%PYTHON% setup.py build
119-
If NOT ERRORLEVEL 0 Goto END
119+
If NOT ERRORLEVEL 0 Goto END
120120
EndLocal
121121

122122
Echo.
@@ -155,7 +155,7 @@ If "%TEST_OBFUSCATED_SCRIPTS%" == "1" (
155155
Echo.
156156
Echo Prepare to run %ENTRY_EXE% with obfuscated scripts
157157
Pause
158-
158+
159159
Cd /D %OUTPUT%
160160
%ENTRY_EXE%
161161
)

src/examples/obfuscate-pkg.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ECHO.
7272
REM Generate an expired license if LICENSE_EXPIRED_DATE is set
7373
SET LICENSE_CODE=expired-%LICENSE_EXPIRED_DATE%
7474
IF DEFINED LICENSE_EXPIRED_DATE (
75-
%PYTHON% pyarmor.py licenses --disable-restrict-mode --expired %LICENSE_EXPIRED_DATE% %LICENSE_CODE%
75+
%PYTHON% pyarmor.py licenses --expired %LICENSE_EXPIRED_DATE% %LICENSE_CODE%
7676
IF NOT ERRORLEVEL 0 GOTO END
7777

7878
REM Overwrite default license with this expired license

src/examples/obfuscate-pkg.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ $PYTHON pyarmor.py obfuscate --recursive --no-restrict --src "$PKGPATH" --entry
4545
if [[ -n "${LICENSE_EXPIRED_DATE}" ]] ; then
4646
echo
4747
LICENSE_CODE="expired-${LICENSE_EXPIRED_DATE}"
48-
$PYTHON pyarmor.py licenses --disable-restrict-mode --expired ${LICENSE_EXPIRED_DATE} ${LICENSE_CODE} || exit 1
48+
$PYTHON pyarmor.py licenses --expired ${LICENSE_EXPIRED_DATE} ${LICENSE_CODE} || exit 1
4949
echo
5050

5151
# Overwrite default license with this expired license

src/packer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def _packer(src, entry, build, script, packcmd, output, libname):
158158

159159
filters = ('global-include *.py', 'prune build, prune dist',
160160
'exclude %s pytransform.py' % entry)
161-
args = ('config', '--runtime-path', '', '--disable-restrict-mode', '1',
162-
'--manifest', ','.join(filters), project)
161+
args = ('config', '--runtime-path', '',
162+
'--manifest', ','.join(filters), project)
163163
call_armor(args)
164164

165165
args = 'build', project

src/user-guide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ to this capsule.
11011101
```
11021102
usage: pyarmor.py licenses [-h] [-e YYYY-MM-DD] [-d SN] [-4 a.b.c.d]
11031103
[-m x:x:x:x] [--bind-domain DOMAIN] [-P PROJECT]
1104-
[-C CAPSULE] [-O OUTPUT] [--disable-restrict-mode]
1104+
[-C CAPSULE] [-O OUTPUT] [--restrict]
11051105
CODE [CODE ...]
11061106
11071107
positional arguments:
@@ -1115,8 +1115,8 @@ optional arguments:
11151115
Project capsule
11161116
-O OUTPUT, --output OUTPUT
11171117
Output path
1118-
--disable-restrict-mode
1119-
Disable restrict mode
1118+
--restrict
1119+
Generate license for restrict mode
11201120
11211121
Bind license to hardware:
11221122
-e YYYY-MM-DD, --expired YYYY-MM-DD
@@ -1155,7 +1155,7 @@ Then generate licenses
11551155
# Expired license
11561156
python pyarmor.py licenses --expired=2018-05-12 Customer-Jordan
11571157
python pyarmor.py licenses --capsule=project2.zip \
1158-
--disable-restrict-mode --output=/home/jondy/project2 \
1158+
--output=/home/jondy/project2 \
11591159
--expired=2018-05-12 Customer-Jordan
11601160
11611161
# Expired license for project

tests/function-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ cp test/data/project.zip .pyarmor_capsule.zip
100100
$PYARMOR licenses --expired=2018-05-12 Customer-Jordan >result.log 2>&1
101101
check_file_exists licenses/Customer-Jordan/license.lic
102102

103-
$PYARMOR licenses --capsule=test/data/project.zip \
104-
--disable-restrict-mode --output=projects \
103+
$PYARMOR licenses --capsule=test/data/project.zip --output=projects \
105104
--expired=2018-05-12 Customer-Jordan >result.log 2>&1
106105
check_file_exists projects/licenses/Customer-Jordan/license.lic
107106

tests/system-test.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ $PYARMOR obfuscate --src examples/simple --entry queens.py \
8787
check_return_value
8888
check_file_exists dist3/queens.py
8989

90-
$PYARMOR licenses --expired $(next_month) --disable-restrict-mode Jondy \
91-
>result.log 2>&1
90+
$PYARMOR licenses --expired $(next_month) Jondy >result.log 2>&1
9291
check_return_value
9392
check_file_exists licenses/Jondy/license.lic
9493
cp licenses/Jondy/license.lic dist3/

0 commit comments

Comments
 (0)