Nuitka-winsvc 1.8.6__cp312-cp312-win_amd64.whl → 1.9.3__cp312-cp312-win_amd64.whl
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.
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/METADATA +1 -1
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/RECORD +212 -203
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/WHEEL +1 -1
- nuitka/BytecodeCaching.py +4 -1
- nuitka/HardImportRegistry.py +348 -0
- nuitka/MainControl.py +45 -25
- nuitka/OptionParsing.py +31 -20
- nuitka/Options.py +47 -16
- nuitka/Progress.py +32 -2
- nuitka/PythonFlavors.py +1 -1
- nuitka/PythonVersions.py +61 -0
- nuitka/Tracing.py +25 -12
- nuitka/TreeXML.py +5 -5
- nuitka/Variables.py +15 -24
- nuitka/Version.py +16 -6
- nuitka/__main__.py +15 -0
- nuitka/__past__.py +15 -17
- nuitka/build/Backend.scons +44 -35
- nuitka/build/CCompilerVersion.scons +10 -9
- nuitka/build/Onefile.scons +11 -26
- nuitka/build/SconsCaching.py +2 -0
- nuitka/build/SconsCompilerSettings.py +72 -22
- nuitka/build/SconsHacks.py +1 -0
- nuitka/build/SconsInterface.py +5 -0
- nuitka/build/SconsSpawn.py +16 -3
- nuitka/build/SconsUtils.py +11 -12
- nuitka/build/include/nuitka/checksum_tools.h +0 -4
- nuitka/build/include/nuitka/compiled_asyncgen.h +1 -1
- nuitka/build/include/nuitka/compiled_coroutine.h +1 -1
- nuitka/build/include/nuitka/compiled_frame.h +7 -4
- nuitka/build/include/nuitka/compiled_function.h +13 -3
- nuitka/build/include/nuitka/compiled_generator.h +1 -1
- nuitka/build/include/nuitka/constants.h +2 -0
- nuitka/build/include/nuitka/environment_variables.h +45 -0
- nuitka/build/include/nuitka/exceptions.h +32 -4
- nuitka/build/include/nuitka/filesystem_paths.h +6 -1
- nuitka/build/include/nuitka/freelists.h +11 -1
- nuitka/build/include/nuitka/helper/dictionaries.h +1 -1
- nuitka/build/include/nuitka/helper/import_hard.h +3 -0
- nuitka/build/include/nuitka/helpers.h +2 -0
- nuitka/build/include/nuitka/importing.h +3 -0
- nuitka/build/include/nuitka/prelude.h +17 -6
- nuitka/build/include/nuitka/unfreezing.h +1 -1
- nuitka/build/inline_copy/bin/scons.py +14 -0
- nuitka/build/inline_copy/tqdm/tqdm/__init__.py +2 -2
- nuitka/build/inline_copy/tqdm/tqdm/utils.py +14 -8
- nuitka/build/inline_copy/zlib/LICENSE +22 -0
- nuitka/build/inline_copy/zlib/crc32.c +1049 -0
- nuitka/build/inline_copy/zlib/crc32.h +9446 -0
- nuitka/build/inline_copy/zlib/zconf.h +551 -0
- nuitka/build/inline_copy/zlib/zlib.h +1938 -0
- nuitka/build/inline_copy/zlib/zutil.h +275 -0
- nuitka/build/static_src/CompiledAsyncgenType.c +41 -41
- nuitka/build/static_src/CompiledCodeHelpers.c +14 -7
- nuitka/build/static_src/CompiledCoroutineType.c +60 -51
- nuitka/build/static_src/CompiledFrameType.c +12 -12
- nuitka/build/static_src/CompiledFunctionType.c +149 -28
- nuitka/build/static_src/CompiledGeneratorType.c +64 -65
- nuitka/build/static_src/CompiledGeneratorTypeUncompiledIntegration.c +1 -1
- nuitka/build/static_src/CompiledMethodType.c +5 -3
- nuitka/build/static_src/HelperEnvironmentVariables.c +120 -0
- nuitka/build/static_src/HelpersAttributes.c +1 -1
- nuitka/build/static_src/HelpersBuiltin.c +1 -1
- nuitka/build/static_src/HelpersChecksumTools.c +19 -4
- nuitka/build/static_src/HelpersComparisonEq.c +4 -4
- nuitka/build/static_src/HelpersComparisonNe.c +4 -4
- nuitka/build/static_src/HelpersConstantsBlob.c +40 -23
- nuitka/build/static_src/HelpersDictionaries.c +3 -1
- nuitka/build/static_src/HelpersDictionariesGenerated.c +9 -9
- nuitka/build/static_src/HelpersFilesystemPaths.c +12 -2
- nuitka/build/static_src/HelpersImport.c +29 -1
- nuitka/build/static_src/HelpersImportHard.c +19 -0
- nuitka/build/static_src/HelpersOperationInplaceAddUtils.c +5 -4
- nuitka/build/static_src/HelpersPythonPgo.c +5 -5
- nuitka/build/static_src/HelpersSafeStrings.c +2 -1
- nuitka/build/static_src/HelpersStrings.c +12 -10
- nuitka/build/static_src/HelpersTypes.c +1 -1
- nuitka/build/static_src/InspectPatcher.c +3 -2
- nuitka/build/static_src/MainProgram.c +182 -214
- nuitka/build/static_src/MetaPathBasedLoader.c +36 -23
- nuitka/build/static_src/MetaPathBasedLoaderImportlibMetadataDistribution.c +4 -2
- nuitka/build/static_src/MetaPathBasedLoaderResourceReaderFiles.c +38 -2
- nuitka/build/static_src/OnefileBootstrap.c +124 -93
- nuitka/code_generation/CodeGeneration.py +4 -2
- nuitka/code_generation/CodeObjectCodes.py +5 -1
- nuitka/code_generation/ConstantCodes.py +4 -0
- nuitka/code_generation/Contexts.py +111 -3
- nuitka/code_generation/DictCodes.py +5 -5
- nuitka/code_generation/FunctionCodes.py +4 -2
- nuitka/code_generation/GlobalConstants.py +10 -0
- nuitka/code_generation/ImportCodes.py +69 -33
- nuitka/code_generation/ModuleCodes.py +4 -1
- nuitka/code_generation/Namify.py +6 -5
- nuitka/code_generation/YieldCodes.py +3 -3
- nuitka/code_generation/templates/CodeTemplatesModules.py +61 -95
- nuitka/code_generation/templates_c/HelperDictionaryCopy.c.j2 +3 -3
- nuitka/code_generation/templates_c/HelperOperationComparisonUnicode.c.j2 +2 -2
- nuitka/distutils/DistutilCommands.py +3 -0
- nuitka/finalizations/FinalizeMarkups.py +1 -1
- nuitka/freezer/DependsExe.py +2 -1
- nuitka/freezer/DllDependenciesPosix.py +11 -1
- nuitka/freezer/IncludedEntryPoints.py +54 -16
- nuitka/freezer/Onefile.py +7 -3
- nuitka/freezer/Standalone.py +39 -17
- nuitka/importing/Importing.py +195 -62
- nuitka/importing/PreloadedPackages.py +2 -1
- nuitka/importing/Recursion.py +98 -27
- nuitka/importing/StandardLibrary.py +7 -4
- nuitka/nodes/BuiltinOpenNodes.py +28 -1
- nuitka/nodes/BuiltinRangeNodes.py +2 -2
- nuitka/nodes/BuiltinSumNodes.py +1 -1
- nuitka/nodes/ChildrenHavingMixins.py +326 -2
- nuitka/nodes/HardImportNodesGenerated.py +141 -38
- nuitka/nodes/ImportHardNodes.py +0 -8
- nuitka/nodes/ImportNodes.py +267 -361
- nuitka/nodes/IterationHandles.py +36 -17
- nuitka/nodes/LocalsScopes.py +3 -1
- nuitka/nodes/NodeBases.py +8 -14
- nuitka/nodes/OperatorNodes.py +9 -9
- nuitka/nodes/OutlineNodes.py +3 -3
- nuitka/nodes/PackageMetadataNodes.py +19 -9
- nuitka/nodes/SliceNodes.py +1 -1
- nuitka/nodes/VariableAssignNodes.py +25 -15
- nuitka/nodes/VariableRefNodes.py +7 -7
- nuitka/nodes/YieldNodes.py +2 -2
- nuitka/nodes/shapes/BuiltinTypeShapes.py +81 -6
- nuitka/nodes/shapes/ShapeMixins.py +21 -0
- nuitka/nodes/shapes/StandardShapes.py +9 -3
- nuitka/optimizations/OptimizeBuiltinCalls.py +1 -1
- nuitka/optimizations/TraceCollections.py +75 -0
- nuitka/pgo/PGO.py +14 -6
- nuitka/plugins/PluginBase.py +83 -11
- nuitka/plugins/Plugins.py +78 -35
- nuitka/plugins/standard/AntiBloatPlugin.py +46 -1
- nuitka/plugins/standard/ConsiderPyLintAnnotationsPlugin.py +1 -1
- nuitka/plugins/standard/DelvewheelPlugin.py +2 -1
- nuitka/plugins/standard/DillPlugin.py +3 -99
- nuitka/plugins/standard/DllFilesPlugin.py +45 -0
- nuitka/plugins/standard/GiPlugin.py +23 -10
- nuitka/plugins/standard/GlfwPlugin.py +1 -0
- nuitka/plugins/standard/ImplicitImports.py +267 -15
- nuitka/plugins/standard/KivyPlugin.py +1 -0
- nuitka/plugins/standard/MatplotlibPlugin.py +43 -25
- nuitka/plugins/standard/OptionsNannyPlugin.py +5 -6
- nuitka/plugins/standard/PkgResourcesPlugin.py +1 -1
- nuitka/plugins/standard/PmwPlugin.py +1 -1
- nuitka/plugins/standard/PySidePyQtPlugin.py +37 -20
- nuitka/plugins/standard/TkinterPlugin.py +44 -30
- nuitka/plugins/standard/TransformersPlugin.py +3 -1
- nuitka/plugins/standard/standard.nuitka-package.config.yml +522 -86
- nuitka/plugins/standard/stdlib3.nuitka-package.config.yml +8 -1
- nuitka/reports/CompilationReportReader.py +53 -0
- nuitka/reports/LicenseReport.rst.j2 +4 -4
- nuitka/reports/Reports.py +129 -47
- nuitka/specs/HardImportSpecs.py +6 -0
- nuitka/tools/data_composer/DataComposer.py +29 -17
- nuitka/tools/onefile_compressor/OnefileCompressor.py +173 -110
- nuitka/tools/podman/__main__.py +17 -2
- nuitka/tools/scanning/DisplayPackageDLLs.py +11 -2
- nuitka/tools/scanning/DisplayPackageData.py +1 -1
- nuitka/tools/specialize/CTypeDescriptions.py +36 -27
- nuitka/tools/specialize/SpecializeC.py +1 -1
- nuitka/tools/specialize/SpecializePython.py +16 -0
- nuitka/tools/testing/Common.py +3 -4
- nuitka/tools/testing/OutputComparison.py +23 -0
- nuitka/tools/testing/SearchModes.py +2 -2
- nuitka/tools/testing/compare_with_cpython/__main__.py +13 -4
- nuitka/tools/testing/measure_construct_performance/__main__.py +2 -5
- nuitka/tools/watch/__main__.py +194 -56
- nuitka/tree/Building.py +8 -2
- nuitka/tree/ComplexCallHelperFunctions.py +45 -15
- nuitka/tree/ReformulationAssignmentStatements.py +18 -12
- nuitka/tree/ReformulationCallExpressions.py +1 -1
- nuitka/tree/ReformulationClasses.py +11 -5
- nuitka/tree/ReformulationClasses3.py +30 -12
- nuitka/tree/ReformulationComparisonExpressions.py +4 -2
- nuitka/tree/ReformulationContractionExpressions.py +19 -11
- nuitka/tree/ReformulationDictionaryCreation.py +9 -3
- nuitka/tree/ReformulationExecStatements.py +6 -6
- nuitka/tree/ReformulationForLoopStatements.py +5 -5
- nuitka/tree/ReformulationFunctionStatements.py +6 -2
- nuitka/tree/ReformulationImportStatements.py +7 -2
- nuitka/tree/ReformulationLambdaExpressions.py +1 -1
- nuitka/tree/ReformulationMatchStatements.py +3 -1
- nuitka/tree/ReformulationNamespacePackages.py +7 -3
- nuitka/tree/ReformulationPrintStatements.py +1 -1
- nuitka/tree/ReformulationSequenceCreation.py +18 -6
- nuitka/tree/ReformulationWithStatements.py +8 -8
- nuitka/tree/ReformulationYieldExpressions.py +2 -2
- nuitka/tree/SourceHandling.py +27 -5
- nuitka/tree/VariableClosure.py +11 -1
- nuitka/utils/AppDirs.py +2 -2
- nuitka/utils/CStrings.py +39 -3
- nuitka/utils/CommandLineOptions.py +42 -1
- nuitka/utils/Distributions.py +305 -38
- nuitka/utils/Download.py +27 -8
- nuitka/utils/FileOperations.py +103 -20
- nuitka/utils/Hashing.py +2 -3
- nuitka/utils/Importing.py +60 -3
- nuitka/utils/InstalledPythons.py +31 -36
- nuitka/utils/Jinja2.py +11 -5
- nuitka/utils/ModuleNames.py +11 -3
- nuitka/utils/ReExecute.py +7 -0
- nuitka/utils/SharedLibraries.py +38 -14
- nuitka/utils/SlotMetaClasses.py +55 -0
- nuitka/utils/Utils.py +10 -0
- nuitka/utils/Yaml.py +9 -1
- nuitka/build/inline_copy/tqdm/tqdm/_tqdm_gui.py +0 -9
- nuitka/build/inline_copy/tqdm/tqdm/gui.py +0 -191
- {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka-run.bat +0 -0
- {Nuitka_winsvc-1.8.6.data → Nuitka_winsvc-1.9.3.data}/scripts/nuitka.bat +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/LICENSE.txt +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/entry_points.txt +0 -0
- {Nuitka_winsvc-1.8.6.dist-info → Nuitka_winsvc-1.9.3.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
|
|
2
|
+
#
|
|
3
|
+
# Part of "Nuitka", an optimizing Python compiler that is compatible and
|
|
4
|
+
# integrates with CPython, but also works on its own.
|
|
5
|
+
#
|
|
6
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
# you may not use this file except in compliance with the License.
|
|
8
|
+
# You may obtain a copy of the License at
|
|
9
|
+
#
|
|
10
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
#
|
|
12
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
# See the License for the specific language governing permissions and
|
|
16
|
+
# limitations under the License.
|
|
17
|
+
#
|
|
18
|
+
""" Helper for portable metaclasses that do checks. """
|
|
19
|
+
|
|
20
|
+
from abc import ABCMeta
|
|
21
|
+
|
|
22
|
+
from nuitka.Errors import NuitkaNodeDesignError
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def getMetaClassBase(meta_class_prefix, require_slots):
|
|
26
|
+
"""For Python2/3 compatible source, we create a base class that has the metaclass
|
|
27
|
+
used and doesn't require making a syntax choice.
|
|
28
|
+
|
|
29
|
+
Also this allows to enforce the proper usage of "__slots__" for all classes using
|
|
30
|
+
it optionally.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
class MetaClass(ABCMeta):
|
|
34
|
+
def __new__(
|
|
35
|
+
mcs, name, bases, dictionary
|
|
36
|
+
): # pylint: disable=I0021,arguments-differ
|
|
37
|
+
if require_slots:
|
|
38
|
+
for base in bases:
|
|
39
|
+
if base is not object and "__slots__" not in base.__dict__:
|
|
40
|
+
raise NuitkaNodeDesignError(
|
|
41
|
+
name, "All bases must set __slots__.", base
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
if "__slots__" not in dictionary:
|
|
45
|
+
raise NuitkaNodeDesignError(name, "Class must set __slots__.", name)
|
|
46
|
+
|
|
47
|
+
return ABCMeta.__new__(mcs, name, bases, dictionary)
|
|
48
|
+
|
|
49
|
+
MetaClassBase = MetaClass(
|
|
50
|
+
"%sMetaClassBase" % meta_class_prefix,
|
|
51
|
+
(object,),
|
|
52
|
+
{"__slots__": ()} if require_slots else {},
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
return MetaClassBase
|
nuitka/utils/Utils.py
CHANGED
|
@@ -21,12 +21,15 @@ Here the small things that fit nowhere else and don't deserve their own module.
|
|
|
21
21
|
|
|
22
22
|
"""
|
|
23
23
|
|
|
24
|
+
import ctypes
|
|
24
25
|
import functools
|
|
25
26
|
import os
|
|
26
27
|
import sys
|
|
27
28
|
import time
|
|
28
29
|
from contextlib import contextmanager
|
|
29
30
|
|
|
31
|
+
from nuitka.__past__ import WindowsError # pylint: disable=I0021,redefined-builtin
|
|
32
|
+
|
|
30
33
|
|
|
31
34
|
def getOS():
|
|
32
35
|
if os.name == "nt":
|
|
@@ -389,3 +392,10 @@ Disable Anti-Virus, e.g. Windows Defender for build folders. Retrying after a se
|
|
|
389
392
|
return retryingFunction
|
|
390
393
|
|
|
391
394
|
return inner
|
|
395
|
+
|
|
396
|
+
|
|
397
|
+
def raiseWindowsError(message):
|
|
398
|
+
raise WindowsError(
|
|
399
|
+
ctypes.GetLastError(),
|
|
400
|
+
"%s (%s)" % (message, ctypes.FormatError(ctypes.GetLastError())),
|
|
401
|
+
)
|
nuitka/utils/Yaml.py
CHANGED
|
@@ -55,6 +55,12 @@ class PackageConfigYaml(object):
|
|
|
55
55
|
for item in data:
|
|
56
56
|
module_name = item.pop("module-name")
|
|
57
57
|
|
|
58
|
+
if not module_name:
|
|
59
|
+
general.sysexit(
|
|
60
|
+
"Error, invalid config in '%s' looks like an empty module name was given."
|
|
61
|
+
% (self.name)
|
|
62
|
+
)
|
|
63
|
+
|
|
58
64
|
if "/" in module_name:
|
|
59
65
|
general.sysexit(
|
|
60
66
|
"Error, invalid module name in '%s' looks like a file path '%s'."
|
|
@@ -107,7 +113,9 @@ def getYamlPackage():
|
|
|
107
113
|
|
|
108
114
|
getYamlPackage.yaml = yaml
|
|
109
115
|
except ImportError:
|
|
110
|
-
getYamlPackage.yaml = importFromInlineCopy(
|
|
116
|
+
getYamlPackage.yaml = importFromInlineCopy(
|
|
117
|
+
"yaml", must_exist=True, delete_module=True
|
|
118
|
+
)
|
|
111
119
|
|
|
112
120
|
return getYamlPackage.yaml
|
|
113
121
|
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
from warnings import warn
|
|
2
|
-
|
|
3
|
-
from .gui import * # NOQA
|
|
4
|
-
from .gui import __all__ # NOQA
|
|
5
|
-
from .std import TqdmDeprecationWarning
|
|
6
|
-
|
|
7
|
-
warn("This function will be removed in tqdm==5.0.0\n"
|
|
8
|
-
"Please use `tqdm.gui.*` instead of `tqdm._tqdm_gui.*`",
|
|
9
|
-
TqdmDeprecationWarning, stacklevel=2)
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Matplotlib GUI progressbar decorator for iterators.
|
|
3
|
-
|
|
4
|
-
Usage:
|
|
5
|
-
>>> from tqdm.gui import trange, tqdm
|
|
6
|
-
>>> for i in trange(10):
|
|
7
|
-
... ...
|
|
8
|
-
"""
|
|
9
|
-
# future division is important to divide integers and get as
|
|
10
|
-
# a result precise floating numbers (instead of truncated int)
|
|
11
|
-
from __future__ import absolute_import, division
|
|
12
|
-
|
|
13
|
-
import re
|
|
14
|
-
from warnings import warn
|
|
15
|
-
|
|
16
|
-
# to inherit from the tqdm class
|
|
17
|
-
from .std import TqdmExperimentalWarning
|
|
18
|
-
from .std import tqdm as std_tqdm
|
|
19
|
-
# import compatibility functions and utilities
|
|
20
|
-
from .utils import _range
|
|
21
|
-
|
|
22
|
-
__author__ = {"github.com/": ["casperdcl", "lrq3000"]}
|
|
23
|
-
__all__ = ['tqdm_gui', 'tgrange', 'tqdm', 'trange']
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
class tqdm_gui(std_tqdm): # pragma: no cover
|
|
27
|
-
"""Experimental Matplotlib GUI version of tqdm!"""
|
|
28
|
-
# TODO: @classmethod: write() on GUI?
|
|
29
|
-
def __init__(self, *args, **kwargs):
|
|
30
|
-
from collections import deque
|
|
31
|
-
|
|
32
|
-
import matplotlib as mpl
|
|
33
|
-
import matplotlib.pyplot as plt
|
|
34
|
-
kwargs = kwargs.copy()
|
|
35
|
-
kwargs['gui'] = True
|
|
36
|
-
colour = kwargs.pop('colour', 'g')
|
|
37
|
-
super(tqdm_gui, self).__init__(*args, **kwargs)
|
|
38
|
-
|
|
39
|
-
if self.disable:
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
warn("GUI is experimental/alpha", TqdmExperimentalWarning, stacklevel=2)
|
|
43
|
-
self.mpl = mpl
|
|
44
|
-
self.plt = plt
|
|
45
|
-
|
|
46
|
-
# Remember if external environment uses toolbars
|
|
47
|
-
self.toolbar = self.mpl.rcParams['toolbar']
|
|
48
|
-
self.mpl.rcParams['toolbar'] = 'None'
|
|
49
|
-
|
|
50
|
-
self.mininterval = max(self.mininterval, 0.5)
|
|
51
|
-
self.fig, ax = plt.subplots(figsize=(9, 2.2))
|
|
52
|
-
# self.fig.subplots_adjust(bottom=0.2)
|
|
53
|
-
total = self.__len__() # avoids TypeError on None #971
|
|
54
|
-
if total is not None:
|
|
55
|
-
self.xdata = []
|
|
56
|
-
self.ydata = []
|
|
57
|
-
self.zdata = []
|
|
58
|
-
else:
|
|
59
|
-
self.xdata = deque([])
|
|
60
|
-
self.ydata = deque([])
|
|
61
|
-
self.zdata = deque([])
|
|
62
|
-
self.line1, = ax.plot(self.xdata, self.ydata, color='b')
|
|
63
|
-
self.line2, = ax.plot(self.xdata, self.zdata, color='k')
|
|
64
|
-
ax.set_ylim(0, 0.001)
|
|
65
|
-
if total is not None:
|
|
66
|
-
ax.set_xlim(0, 100)
|
|
67
|
-
ax.set_xlabel("percent")
|
|
68
|
-
self.fig.legend((self.line1, self.line2), ("cur", "est"),
|
|
69
|
-
loc='center right')
|
|
70
|
-
# progressbar
|
|
71
|
-
self.hspan = plt.axhspan(0, 0.001, xmin=0, xmax=0, color=colour)
|
|
72
|
-
else:
|
|
73
|
-
# ax.set_xlim(-60, 0)
|
|
74
|
-
ax.set_xlim(0, 60)
|
|
75
|
-
ax.invert_xaxis()
|
|
76
|
-
ax.set_xlabel("seconds")
|
|
77
|
-
ax.legend(("cur", "est"), loc='lower left')
|
|
78
|
-
ax.grid()
|
|
79
|
-
# ax.set_xlabel('seconds')
|
|
80
|
-
ax.set_ylabel((self.unit if self.unit else "it") + "/s")
|
|
81
|
-
if self.unit_scale:
|
|
82
|
-
plt.ticklabel_format(style='sci', axis='y', scilimits=(0, 0))
|
|
83
|
-
ax.yaxis.get_offset_text().set_x(-0.15)
|
|
84
|
-
|
|
85
|
-
# Remember if external environment is interactive
|
|
86
|
-
self.wasion = plt.isinteractive()
|
|
87
|
-
plt.ion()
|
|
88
|
-
self.ax = ax
|
|
89
|
-
|
|
90
|
-
def close(self):
|
|
91
|
-
if self.disable:
|
|
92
|
-
return
|
|
93
|
-
|
|
94
|
-
self.disable = True
|
|
95
|
-
|
|
96
|
-
with self.get_lock():
|
|
97
|
-
self._instances.remove(self)
|
|
98
|
-
|
|
99
|
-
# Restore toolbars
|
|
100
|
-
self.mpl.rcParams['toolbar'] = self.toolbar
|
|
101
|
-
# Return to non-interactive mode
|
|
102
|
-
if not self.wasion:
|
|
103
|
-
self.plt.ioff()
|
|
104
|
-
if self.leave:
|
|
105
|
-
self.display()
|
|
106
|
-
else:
|
|
107
|
-
self.plt.close(self.fig)
|
|
108
|
-
|
|
109
|
-
def clear(self, *_, **__):
|
|
110
|
-
pass
|
|
111
|
-
|
|
112
|
-
def display(self, *_, **__):
|
|
113
|
-
n = self.n
|
|
114
|
-
cur_t = self._time()
|
|
115
|
-
elapsed = cur_t - self.start_t
|
|
116
|
-
delta_it = n - self.last_print_n
|
|
117
|
-
delta_t = cur_t - self.last_print_t
|
|
118
|
-
|
|
119
|
-
# Inline due to multiple calls
|
|
120
|
-
total = self.total
|
|
121
|
-
xdata = self.xdata
|
|
122
|
-
ydata = self.ydata
|
|
123
|
-
zdata = self.zdata
|
|
124
|
-
ax = self.ax
|
|
125
|
-
line1 = self.line1
|
|
126
|
-
line2 = self.line2
|
|
127
|
-
# instantaneous rate
|
|
128
|
-
y = delta_it / delta_t
|
|
129
|
-
# overall rate
|
|
130
|
-
z = n / elapsed
|
|
131
|
-
# update line data
|
|
132
|
-
xdata.append(n * 100.0 / total if total else cur_t)
|
|
133
|
-
ydata.append(y)
|
|
134
|
-
zdata.append(z)
|
|
135
|
-
|
|
136
|
-
# Discard old values
|
|
137
|
-
# xmin, xmax = ax.get_xlim()
|
|
138
|
-
# if (not total) and elapsed > xmin * 1.1:
|
|
139
|
-
if (not total) and elapsed > 66:
|
|
140
|
-
xdata.popleft()
|
|
141
|
-
ydata.popleft()
|
|
142
|
-
zdata.popleft()
|
|
143
|
-
|
|
144
|
-
ymin, ymax = ax.get_ylim()
|
|
145
|
-
if y > ymax or z > ymax:
|
|
146
|
-
ymax = 1.1 * y
|
|
147
|
-
ax.set_ylim(ymin, ymax)
|
|
148
|
-
ax.figure.canvas.draw()
|
|
149
|
-
|
|
150
|
-
if total:
|
|
151
|
-
line1.set_data(xdata, ydata)
|
|
152
|
-
line2.set_data(xdata, zdata)
|
|
153
|
-
try:
|
|
154
|
-
poly_lims = self.hspan.get_xy()
|
|
155
|
-
except AttributeError:
|
|
156
|
-
self.hspan = self.plt.axhspan(0, 0.001, xmin=0, xmax=0, color='g')
|
|
157
|
-
poly_lims = self.hspan.get_xy()
|
|
158
|
-
poly_lims[0, 1] = ymin
|
|
159
|
-
poly_lims[1, 1] = ymax
|
|
160
|
-
poly_lims[2] = [n / total, ymax]
|
|
161
|
-
poly_lims[3] = [poly_lims[2, 0], ymin]
|
|
162
|
-
if len(poly_lims) > 4:
|
|
163
|
-
poly_lims[4, 1] = ymin
|
|
164
|
-
self.hspan.set_xy(poly_lims)
|
|
165
|
-
else:
|
|
166
|
-
t_ago = [cur_t - i for i in xdata]
|
|
167
|
-
line1.set_data(t_ago, ydata)
|
|
168
|
-
line2.set_data(t_ago, zdata)
|
|
169
|
-
|
|
170
|
-
d = self.format_dict
|
|
171
|
-
# remove {bar}
|
|
172
|
-
d['bar_format'] = (d['bar_format'] or "{l_bar}<bar/>{r_bar}").replace(
|
|
173
|
-
"{bar}", "<bar/>")
|
|
174
|
-
msg = self.format_meter(**d)
|
|
175
|
-
if '<bar/>' in msg:
|
|
176
|
-
msg = "".join(re.split(r'\|?<bar/>\|?', msg, 1))
|
|
177
|
-
ax.set_title(msg, fontname="DejaVu Sans Mono", fontsize=11)
|
|
178
|
-
self.plt.pause(1e-9)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
def tgrange(*args, **kwargs):
|
|
182
|
-
"""
|
|
183
|
-
A shortcut for `tqdm.gui.tqdm(xrange(*args), **kwargs)`.
|
|
184
|
-
On Python3+, `range` is used instead of `xrange`.
|
|
185
|
-
"""
|
|
186
|
-
return tqdm_gui(_range(*args), **kwargs)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
# Aliases
|
|
190
|
-
tqdm = tqdm_gui
|
|
191
|
-
trange = tgrange
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|