pyarmor 8.5.0__zip → 8.5.2__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyarmor-8.5.0 → pyarmor-8.5.2}/PKG-INFO +1 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/build_meta.py +6 -6
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/__init__.py +1 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/__main__.py +2 -31
- pyarmor-8.5.2/pyarmor/cli/bug.py +119 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/context.py +2 -2
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/default.cfg +1 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/config.py +1 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/packer.py +5 -1
- pyarmor-8.5.2/pyarmor/polyfills/__init__.py +62 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/PKG-INFO +1 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/SOURCES.txt +1 -0
- pyarmor-8.5.0/pyarmor/polyfills/__init__.py +0 -1
- {pyarmor-8.5.0 → pyarmor-8.5.2}/MANIFEST.in +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/README.md +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/README.rst +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/__init__.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/benchmark.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/bootstrap.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/config.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/core.data.1 +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/core.data.2 +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/core.data.3 +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/docker.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/generate.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/hdinfo.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/merge.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/mixer.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/plugin.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/public_capsule.zip +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/register.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/repack.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/resource.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cli/shell.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/cobuilder.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/README-ZH.md +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/README.md +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/build-for-exe.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/build-for-freeze.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/build-with-project.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/build-with-project.sh +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/cx_Freeze/hello.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/cx_Freeze/queens.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/cx_Freeze/setup.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/helloworld/foo.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/obfuscate-app.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/obfuscate-app.sh +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/obfuscate-pkg.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/obfuscate-pkg.sh +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pack-obfuscated-scripts.bat +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pack-obfuscated-scripts.sh +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/py2exe/hello.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/py2exe/queens.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/py2exe/setup.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Arithmetic.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Calls.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/CommandLine.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Constructs.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Dict.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Exceptions.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Imports.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Instances.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Lists.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Lookups.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/NewInstances.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Numbers.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Setup.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Strings.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/Tuples.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/With.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/clockres.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/package/__init__.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/package/submodule.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/pybench.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/pybench/systimes.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/simple/queens.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/testmod/hello.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/testmod/queens.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/testpkg/main.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/testpkg/mypkg/__init__.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/examples/testpkg/mypkg/foo.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/__init__.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/build_data_module.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/buildext.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/get_bind_key.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/get_license_info.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/get_platform_name.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/merge.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/repack.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/helper/superuntime.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/license.tri +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/platforms/darwin/x86_64/_pytransform.dylib +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/platforms/linux/x86/_pytransform.so +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/platforms/linux/x86_64/_pytransform.so +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/platforms/windows/x86/_pytransform.dll +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/platforms/windows/x86_64/_pytransform.dll +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/plugins/README.md +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/plugins/check_ntp_time.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/polyfills/argparse.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/product.key +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/project.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/protect_code.pt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/protect_code2.pt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/public.key +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/public_capsule.zip +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyarmor-deprecated.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyarmor-webui.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyarmor.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyimcore.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyshield.key +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pyshield.lic +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/pytransform.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/reform.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/register.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/sppmode.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor/utils.py +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/dependency_links.txt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/entry_points.txt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/requires.txt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/pyarmor.egg-info/top_level.txt +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/setup.cfg +0 -0
- {pyarmor-8.5.0 → pyarmor-8.5.2}/setup.py +0 -0
|
@@ -32,11 +32,12 @@ from wheel.wheelfile import WheelFile
|
|
|
32
32
|
from wheel.cli.pack import pack as wheel_pack
|
|
33
33
|
from pyarmor.pyarmor import main as pyarmor_main
|
|
34
34
|
|
|
35
|
-
from setuptools.build_meta import build_wheel as setuptools_build_wheel
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
from setuptools.build_meta import build_wheel as setuptools_build_wheel
|
|
36
|
+
|
|
37
|
+
try:
|
|
38
|
+
from distutils.util import get_platform
|
|
39
|
+
except ModuleNotFoundError:
|
|
40
|
+
from polyfills import get_platform
|
|
40
41
|
|
|
41
42
|
|
|
42
43
|
def _wheel_unpack(path, dest='.'):
|
|
@@ -82,7 +83,6 @@ def _fix_config(config_settings, obf_options):
|
|
|
82
83
|
config_settings = config_settings or {}
|
|
83
84
|
global_options = config_settings.get('--global-option', [])
|
|
84
85
|
|
|
85
|
-
from distutils.util import get_platform
|
|
86
86
|
plat_name = get_platform().replace('-', '_').replace('.', '_')
|
|
87
87
|
global_options.append('--plat-name=%s' % plat_name)
|
|
88
88
|
|
|
@@ -32,6 +32,7 @@ from .shell import PyarmorShell
|
|
|
32
32
|
from .plugin import Plugin
|
|
33
33
|
from .generate import Builder
|
|
34
34
|
from .bootstrap import check_prebuilt_runtime_library
|
|
35
|
+
from .bug import find_solutions
|
|
35
36
|
|
|
36
37
|
|
|
37
38
|
def _cmd_gen_key(builder, options):
|
|
@@ -327,7 +328,7 @@ def cmd_reg(ctx, args):
|
|
|
327
328
|
|
|
328
329
|
|
|
329
330
|
def cmd_man(ctx, args):
|
|
330
|
-
pkgpath = os.path.
|
|
331
|
+
pkgpath = os.path.join(os.path.dirname(__file__), '..', 'man')
|
|
331
332
|
if not os.path.exists(pkgpath):
|
|
332
333
|
from subprocess import check_output
|
|
333
334
|
check_output([
|
|
@@ -746,36 +747,6 @@ def main_entry(argv):
|
|
|
746
747
|
parser.print_help()
|
|
747
748
|
|
|
748
749
|
|
|
749
|
-
def find_solutions(e):
|
|
750
|
-
'''Print quick solutions according to exception
|
|
751
|
-
|
|
752
|
-
If not enable debug, tell user try `pyarmor -d cmd...`
|
|
753
|
-
|
|
754
|
-
If it raises CliError, print possible solutions
|
|
755
|
-
|
|
756
|
-
For unknown error, print FAQ page link and `pyarmor man`
|
|
757
|
-
|
|
758
|
-
Pyarmor Man is designed to help Pyarmor users to learn
|
|
759
|
-
and use Pyarmor by web-ui, to find solution quickly when
|
|
760
|
-
something is wrong, to report bugs and ask questions in
|
|
761
|
-
standard form in order to save both Pyarmor team's and
|
|
762
|
-
Pyarmor users' time.
|
|
763
|
-
'''
|
|
764
|
-
# debug = logging.getLogger().getEffectiveLevel()
|
|
765
|
-
# clierr = isinstance(e, CliError)
|
|
766
|
-
logger.error('''somthing is wrong
|
|
767
|
-
*===========================================================*
|
|
768
|
-
* Please check *
|
|
769
|
-
* https://pyarmor.readthedocs.io/en/latest/questions.html*
|
|
770
|
-
* or run `pyarmor man` to find solutions quickly *
|
|
771
|
-
* *
|
|
772
|
-
* It's recommand to report issue by `pyarmor man` in order *
|
|
773
|
-
* to provide necessary information, and avoid dupcliated *
|
|
774
|
-
* issues or unclear question. *
|
|
775
|
-
*===========================================================*
|
|
776
|
-
''')
|
|
777
|
-
|
|
778
|
-
|
|
779
750
|
def main():
|
|
780
751
|
logging.basicConfig(
|
|
781
752
|
level=logging.INFO,
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
#! /usr/bin/env python
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
#
|
|
4
|
+
#############################################################
|
|
5
|
+
# #
|
|
6
|
+
# Copyright @ 2024 - Dashingsoft corp. #
|
|
7
|
+
# All rights reserved. #
|
|
8
|
+
# #
|
|
9
|
+
# Pyarmor #
|
|
10
|
+
# #
|
|
11
|
+
# Version: 8.5.1 - #
|
|
12
|
+
# #
|
|
13
|
+
#############################################################
|
|
14
|
+
#
|
|
15
|
+
#
|
|
16
|
+
# @File: cli/bug.py
|
|
17
|
+
#
|
|
18
|
+
# @Author: Jondy Zhao (pyarmor@163.com)
|
|
19
|
+
#
|
|
20
|
+
# @Create Date: Tue Mar 12 15:19:41 CST 2024
|
|
21
|
+
#
|
|
22
|
+
import logging
|
|
23
|
+
|
|
24
|
+
from string import Template
|
|
25
|
+
|
|
26
|
+
BUG_FILE, LOG_FILE = 'pyarmor.report.bug', '.pyarmor/pyarmor.debug.log'
|
|
27
|
+
|
|
28
|
+
BUG_TEMPLATE = Template('''[Bug] $title
|
|
29
|
+
|
|
30
|
+
### Full command options and console output
|
|
31
|
+
$cmdline
|
|
32
|
+
|
|
33
|
+
$tracelog
|
|
34
|
+
|
|
35
|
+
### Traceback
|
|
36
|
+
$tb
|
|
37
|
+
''')
|
|
38
|
+
|
|
39
|
+
ENABLE_DEBUG_HINTS = '''somthing is wrong
|
|
40
|
+
*=============================================================*
|
|
41
|
+
* Please enable debug option `-d` to run it again *
|
|
42
|
+
* pyarmor -d gen options ... *
|
|
43
|
+
* *
|
|
44
|
+
* Then check console log to find more information *
|
|
45
|
+
* *
|
|
46
|
+
* Please also check *
|
|
47
|
+
* https://pyarmor.readthedocs.io/en/latest/questions.html *
|
|
48
|
+
* or run `pyarmor man` to find solutions quickly *
|
|
49
|
+
*=============================================================*
|
|
50
|
+
'''
|
|
51
|
+
|
|
52
|
+
SOLUTION_HINTS = Template('''somthing is wrong
|
|
53
|
+
*=============================================================*
|
|
54
|
+
* Please check *
|
|
55
|
+
* https://pyarmor.readthedocs.io/en/latest/questions.html *
|
|
56
|
+
* or run `pyarmor man` to find solutions quickly *
|
|
57
|
+
* *
|
|
58
|
+
* It's recommand to report issue by `pyarmor man` in order *
|
|
59
|
+
* to provide necessary information, and avoid dupcliated *
|
|
60
|
+
* issues or unclear question. *
|
|
61
|
+
*=============================================================*
|
|
62
|
+
''')
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def generate_bug_report(e, logfile=LOG_FILE, output=BUG_FILE):
|
|
66
|
+
'Generate file `pyarmor.report.bug` in current path'
|
|
67
|
+
from os.path import exists
|
|
68
|
+
from sys import argv
|
|
69
|
+
from traceback import format_exc
|
|
70
|
+
|
|
71
|
+
if exists(logfile):
|
|
72
|
+
with open(logfile, 'r') as f:
|
|
73
|
+
lines = f.readlines()
|
|
74
|
+
n = len(lines)
|
|
75
|
+
if n > 128:
|
|
76
|
+
tracelog = ''.join(lines[:100] + ['...\n'] + lines[n-20:n])
|
|
77
|
+
else:
|
|
78
|
+
tracelog = ''.join(lines[:n])
|
|
79
|
+
else:
|
|
80
|
+
tracelog = Template(
|
|
81
|
+
'TODO: no found logfile "$logfile", please paste console log '
|
|
82
|
+
'here manually').substitute(logfile=logfile)
|
|
83
|
+
|
|
84
|
+
title = '%s: %s' % (type(e).__name__, str(e))
|
|
85
|
+
with open(output, 'w') as f:
|
|
86
|
+
f.write(BUG_TEMPLATE.substitute(
|
|
87
|
+
title=title,
|
|
88
|
+
cmdline=' '.join(argv),
|
|
89
|
+
tracelog=tracelog,
|
|
90
|
+
tb=format_exc()
|
|
91
|
+
))
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def find_solutions(e):
|
|
95
|
+
'''Print quick solutions according to exception
|
|
96
|
+
|
|
97
|
+
If not enable debug, tell user try `pyarmor -d cmd...`
|
|
98
|
+
|
|
99
|
+
If it raises CliError, print possible solutions
|
|
100
|
+
|
|
101
|
+
For unknown error, print FAQ page link and `pyarmor man`
|
|
102
|
+
|
|
103
|
+
Pyarmor Man is designed to help Pyarmor users to learn
|
|
104
|
+
and use Pyarmor by web-ui, to find solution quickly when
|
|
105
|
+
something is wrong, to report bugs and ask questions in
|
|
106
|
+
standard form in order to save both Pyarmor team's and
|
|
107
|
+
Pyarmor users' time.
|
|
108
|
+
'''
|
|
109
|
+
logger = logging.getLogger()
|
|
110
|
+
if logger.getEffectiveLevel() > logging.DEBUG:
|
|
111
|
+
logger.error(ENABLE_DEBUG_HINTS)
|
|
112
|
+
return
|
|
113
|
+
|
|
114
|
+
generate_bug_report(e)
|
|
115
|
+
logger.error(SOLUTION_HINTS.substitute(bugfile=BUG_FILE))
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
if __name__ == '__main__':
|
|
119
|
+
pass
|
|
@@ -58,7 +58,7 @@ def __pyarmor__():
|
|
|
58
58
|
def format_machine():
|
|
59
59
|
mach = platform.machine().lower()
|
|
60
60
|
arch_table = (
|
|
61
|
-
('x86', ('i386', 'i486', 'i586', 'i686')),
|
|
61
|
+
('x86', ('i386', 'i486', 'i586', 'i686', 'x86')),
|
|
62
62
|
('x86_64', ('x64', 'x86_64', 'amd64', 'intel')),
|
|
63
63
|
('arm', ('armv5',)),
|
|
64
64
|
('armv6', ('armv6l',)),
|
|
@@ -104,7 +104,7 @@ def format_platform(plat, arch):
|
|
|
104
104
|
)
|
|
105
105
|
|
|
106
106
|
arch_table = (
|
|
107
|
-
('x86', ('i?86', )),
|
|
107
|
+
('x86', ('i?86', 'x86')),
|
|
108
108
|
('x86_64', ('x64', 'x86_64', 'amd64', 'intel')),
|
|
109
109
|
('arm', ('armv5',)),
|
|
110
110
|
('armv6', ('armv6l',)),
|
|
@@ -44,7 +44,6 @@ import shutil
|
|
|
44
44
|
import sys
|
|
45
45
|
|
|
46
46
|
from codecs import open as codecs_open
|
|
47
|
-
from distutils.util import get_platform
|
|
48
47
|
from glob import glob
|
|
49
48
|
from json import load as json_load
|
|
50
49
|
from py_compile import compile as compile_file
|
|
@@ -54,6 +53,11 @@ from zipfile import PyZipFile
|
|
|
54
53
|
|
|
55
54
|
import polyfills.argparse as argparse
|
|
56
55
|
|
|
56
|
+
try:
|
|
57
|
+
from distutils.util import get_platform
|
|
58
|
+
except ModuleNotFoundError:
|
|
59
|
+
from polyfills import get_platform
|
|
60
|
+
|
|
57
61
|
# Default output path, library name, command options for setup script
|
|
58
62
|
DEFAULT_PACKER = {
|
|
59
63
|
'py2app': ('dist', 'library.zip', ['py2app', '--dist-dir']),
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Package pyarmor.polyfills
|
|
2
|
+
|
|
3
|
+
# Polyfills for distutils.util.get_platform
|
|
4
|
+
def get_platform ():
|
|
5
|
+
import os
|
|
6
|
+
import re
|
|
7
|
+
import sys
|
|
8
|
+
|
|
9
|
+
if os.name == 'nt':
|
|
10
|
+
if 'amd64' in sys.version.lower():
|
|
11
|
+
return 'win-amd64'
|
|
12
|
+
return sys.platform
|
|
13
|
+
|
|
14
|
+
# Set for cross builds explicitly
|
|
15
|
+
if "_PYTHON_HOST_PLATFORM" in os.environ:
|
|
16
|
+
return os.environ["_PYTHON_HOST_PLATFORM"]
|
|
17
|
+
|
|
18
|
+
if os.name != "posix" or not hasattr(os, 'uname'):
|
|
19
|
+
# XXX what about the architecture? NT is Intel or Alpha,
|
|
20
|
+
# Mac OS is M68k or PPC, etc.
|
|
21
|
+
return sys.platform
|
|
22
|
+
|
|
23
|
+
# Try to distinguish various flavours of Unix
|
|
24
|
+
|
|
25
|
+
(osname, host, release, version, machine) = os.uname()
|
|
26
|
+
|
|
27
|
+
# Convert the OS name to lowercase, remove '/' characters, and translate
|
|
28
|
+
# spaces (for "Power Macintosh")
|
|
29
|
+
osname = osname.lower().replace('/', '')
|
|
30
|
+
machine = machine.replace(' ', '_')
|
|
31
|
+
machine = machine.replace('/', '-')
|
|
32
|
+
|
|
33
|
+
if osname[:5] == "linux":
|
|
34
|
+
# At least on Linux/Intel, 'machine' is the processor --
|
|
35
|
+
# i386, etc.
|
|
36
|
+
# XXX what about Alpha, SPARC, etc?
|
|
37
|
+
return "%s-%s" % (osname, machine)
|
|
38
|
+
elif osname[:5] == "sunos":
|
|
39
|
+
if release[0] >= "5": # SunOS 5 == Solaris 2
|
|
40
|
+
osname = "solaris"
|
|
41
|
+
release = "%d.%s" % (int(release[0]) - 3, release[2:])
|
|
42
|
+
# We can't use "platform.architecture()[0]" because a
|
|
43
|
+
# bootstrap problem. We use a dict to get an error
|
|
44
|
+
# if some suspicious happens.
|
|
45
|
+
bitness = {2147483647:"32bit", 9223372036854775807:"64bit"}
|
|
46
|
+
machine += ".%s" % bitness[sys.maxsize]
|
|
47
|
+
# fall through to standard osname-release-machine representation
|
|
48
|
+
elif osname[:3] == "aix":
|
|
49
|
+
return "%s-%s.%s" % (osname, version, release)
|
|
50
|
+
elif osname[:6] == "cygwin":
|
|
51
|
+
osname = "cygwin"
|
|
52
|
+
rel_re = re.compile (r'[\d.]+', re.ASCII)
|
|
53
|
+
m = rel_re.match(release)
|
|
54
|
+
if m:
|
|
55
|
+
release = m.group()
|
|
56
|
+
elif osname[:6] == "darwin":
|
|
57
|
+
import _osx_support, sysconfig
|
|
58
|
+
osname, release, machine = _osx_support.get_platform_osx(
|
|
59
|
+
sysconfig.get_config_vars(),
|
|
60
|
+
osname, release, machine)
|
|
61
|
+
|
|
62
|
+
return "%s-%s-%s" % (osname, release, machine)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# Package pyarmor.polyfills
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|