Skip to content

Commit

Permalink
Added more Pyinstaller options (#9)
Browse files Browse the repository at this point in the history
Added support for more Pyinstaller options when using `.py` file type:
--add-data <SRC;DEST or SRC:DEST>,
--add-binary <SRC;DEST or SRC:DEST>,
--collect-data <MODULENAME>,
--collect-all <MODULENAME>
  • Loading branch information
Nackophilz authored Aug 6, 2023
1 parent f1a8db9 commit 454cc5f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ You can also use any major tags like `@v1` for any `@v1.*.*`
| `--noupx` | `--key <KEY>` |
| `--onedir`, `-D` | `--upx-dir <UPX_DIR>` |
| `--onefile`, `-F` | `--upx-exclude <FILE>` |
| `--ascii`, `-a`
| `--console`, `--nowindowed`, `-c`
| `--windowed`, `--noconsole`, `-w`
| `--ascii`, `-a` | `--add-data <SRC;DEST or SRC:DEST>` |
| `--console`, `--nowindowed`, `-c` | `--add-binary <SRC;DEST or SRC:DEST>` |
| `--windowed`, `--noconsole`, `-w` | `--collect-data <MODULENAME>` |
| | `--collect-all <MODULENAME>` |


<br>
Expand Down
18 changes: 8 additions & 10 deletions src/mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
'--upx-dir <UPX_DIR>',
'--upx-exclude <FILE>',

'--add-data <SRC;DEST or SRC:DEST>',
'--add-binary <SRC;DEST or SRC:DEST>',
'--collect-data <MODULENAME>',
'--collect-all <MODULENAME>',

'--name <NAME>', '-n <NAME>',
'--icon <FILEICON>', '-i <FILEICON>',
]
Expand Down Expand Up @@ -89,21 +94,14 @@


def get_option_value(option:str):
""" Returns: Value of `option` from provided options (if available) """
""" Returns: Value of `option` from provided options """
for i in supported_options:
iList = i.split(
maxsplit=1
)
iList = i.split(maxsplit=1)
if len(iList) < 2:
continue
key, value, *_ = iList
if key == option:
return value.strip(
'"'
).strip(
"'"
)

return value.strip('"').strip("'")


## ---------------------- Spec Name ---------------------- ##
Expand Down

0 comments on commit 454cc5f

Please sign in to comment.