diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d947e5..395b1182 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +### 2.12.0 +- [#211](https://github.com/brentvollebregt/auto-py-to-exe/pull/211): Added Traditional Chinese translations +- [#218](https://github.com/brentvollebregt/auto-py-to-exe/issues/218): Added build directory override argument (`--build-directory-override`) +- [#221](https://github.com/brentvollebregt/auto-py-to-exe/issues/221): Added an overlay spinner to hide content until the UI is initialised + ### 2.11.0 - [#205](https://github.com/brentvollebregt/auto-py-to-exe/issues/205): Added support for PyInstaller 4.6 and its new options - Dropped support for Python 3.5 diff --git a/README.md b/README.md index 07f4317b..f7562368 100644 --- a/README.md +++ b/README.md @@ -68,13 +68,15 @@ Now to run the application, execute ```python -m auto_py_to_exe```. A Chrome win ### Arguments Usage: `auto-py-to-exe [-nc] [-c [CONFIG]] [-o [PATH]] [filename]` -| Argument | Type | Description | -|--------------------------------|------------|-----------------------------------------------------------------------------------------------------------------| -| filename | positional | Pre-fill the "Script Location" field in the UI. | -| -nc, --no-chrome | optional | Open the UI using the default browser (which may be Chrome). Will not try to find Chrome. | -| -nu, --no-ui | optional | Don't try to open the UI in a browser and simply print out the address that the application can be accessed at. | -| -c [CONFIG], --config [CONFIG] | optional | Provide a configuration file (json) to pre-fill the UI. These can be generated in the settings tab. | -| -o [PATH], --output-dir [PATH] | optional | Set the default output directory. This can still be changed in the ui. | +| Argument | Type | Description | +| ------------------------------------------------------------ | ------------------- | -------------------------------------------------------------------------------------------------------------------------- | +| filename | positional/optional | Pre-fill the "Script Location" field in the UI. | +| -nc, --no-chrome | optional | Open the UI using the default browser (which may be Chrome). Will not try to find Chrome. | +| -nu, --no-ui | optional | Don't try to open the UI in a browser and simply print out the address that the application can be accessed at. | +| -c [CONFIG], --config [CONFIG] | optional | Provide a configuration file (json) to pre-fill the UI. These can be generated in the settings tab. | +| -o [PATH], --output-dir [PATH] | optional | Set the default output directory. This can still be changed in the ui. | +| -bdo [FOLDER_PATH], --build-directory-override [FOLDER_PATH] | optional | Override the default build directory. Useful if you need to whitelist a folder to stop your antivirus from removing files. | + > If you are running this package locally, you will need to call ```python -m auto_py_to_exe``` instead of ```auto-py-to-exe``` diff --git a/auto_py_to_exe/__init__.py b/auto_py_to_exe/__init__.py index fb7a749a..0b288f83 100644 --- a/auto_py_to_exe/__init__.py +++ b/auto_py_to_exe/__init__.py @@ -1 +1 @@ -__version__ = '2.11.0' +__version__ = '2.12.0' diff --git a/auto_py_to_exe/__main__.py b/auto_py_to_exe/__main__.py index 9a116983..d6244476 100644 --- a/auto_py_to_exe/__main__.py +++ b/auto_py_to_exe/__main__.py @@ -10,19 +10,23 @@ from . import ui -def start_ui(logging_level): +def start_ui(logging_level, build_directory_override): """ Open the interface """ # Suppress the global logger to only show error+ to the console logging.getLogger().handlers[0].setLevel(logging_level) - # Setup a temporary folder to build in - config.temporary_directory = tempfile.mkdtemp() + # Setup the build folder + if build_directory_override is None: + config.temporary_directory = tempfile.mkdtemp() + else: + config.temporary_directory = build_directory_override # Start UI ui.start(config.ui_open_mode) - # Remove temporary folder to clean up from builds - shutil.rmtree(config.temporary_directory) + # Remove build folder to clean up from builds (if we created it) + if build_directory_override is None: + shutil.rmtree(config.temporary_directory) def run(): @@ -64,6 +68,13 @@ def run(): help="the directory to put output in", default='output' ) + parser.add_argument( + "-bdo", + "--build-directory-override", + nargs='?', + help="a directory for build files (overrides the default)", + default=None + ) parser.add_argument( "--logging-level", nargs='?', @@ -91,12 +102,16 @@ def run(): else: config.ui_open_mode = config.UIOpenMode.CHROME + # Validate --build-directory-override exists if supplied + if (args.build_directory_override is not None) and (not os.path.isdir(args.build_directory_override)): + raise ValueError("--build-directory-override must be a directory") + # If the user has asked for the version, print it, otherwise run the application if args.version: print('auto-py-to-exe ' + __version__) else: logging_level = getattr(logging, args.logging_level) - start_ui(logging_level) + start_ui(logging_level, args.build_directory_override) if __name__ == '__main__': diff --git a/auto_py_to_exe/web/css/main.css b/auto_py_to_exe/web/css/main.css index ecbdc922..8e49a491 100644 --- a/auto_py_to_exe/web/css/main.css +++ b/auto_py_to_exe/web/css/main.css @@ -264,3 +264,64 @@ div[id*="section"] .content { #open-output-folder-button.show { display: block; } + +/* Loading spinner (from https://projects.lukehaas.me/css-loaders/) */ + +.loading-spinner-wrapper { + display: flex; + position: fixed; + left: 0; + top: 0; + width: 100%; + height: 100vh; + align-items: center; + justify-content: center; + background: rgb(0 0 0 / 75%); +} + +.loading-label { + color: white; +} + +.loading-spinner, +.loading-spinner:after { + border-radius: 50%; + width: 8em; + height: 8em; +} +.loading-spinner { + margin: 60px auto; + font-size: 10px; + position: relative; + text-indent: -9999em; + border-top: 1.1em solid rgba(256,256,256, 0.2); + border-right: 1.1em solid rgba(256,256,256, 0.2); + border-bottom: 1.1em solid rgba(256,256,256, 0.2); + border-left: 1.1em solid #FFFFFF; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-animation: load8 1.1s infinite linear; + animation: load8 1.1s infinite linear; +} +@-webkit-keyframes load8 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} +@keyframes load8 { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + diff --git a/auto_py_to_exe/web/index.html b/auto_py_to_exe/web/index.html index adb0aa4b..703cf0b5 100644 --- a/auto_py_to_exe/web/index.html +++ b/auto_py_to_exe/web/index.html @@ -232,6 +232,14 @@