Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
brentvollebregt committed Dec 3, 2021
2 parents a352917 + 89981b8 commit 8b87a3c
Show file tree
Hide file tree
Showing 8 changed files with 240 additions and 73 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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```
Expand Down
2 changes: 1 addition & 1 deletion auto_py_to_exe/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.11.0'
__version__ = '2.12.0'
27 changes: 21 additions & 6 deletions auto_py_to_exe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -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='?',
Expand Down Expand Up @@ -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__':
Expand Down
61 changes: 61 additions & 0 deletions auto_py_to_exe/web/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

8 changes: 8 additions & 0 deletions auto_py_to_exe/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,14 @@ <h2 data-i18n="ui.title.output">Output</h2>
</button>
</div>
</div>

<div id="modal-area" class="modal-coverage modal-coverage-hidden"></div>

<div id="spinner-root" class="loading-spinner-wrapper">
<div>
<div class="loading-spinner"></div>
<span class="loading-label">Initializing...</span>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 8b87a3c

Please sign in to comment.