Skip to content

Commit 5a183bc

Browse files
committed
big difference
1.0.0 pre2
1 parent 9ade86f commit 5a183bc

18 files changed

+1735
-290
lines changed

.DS_Store

2 KB
Binary file not shown.

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,23 @@ jobs:
2121
python-version: '3.13'
2222
- name: Install Dependencies
2323
run: |
24-
chmod +x build.command
24+
chmod +x build_nk.command
2525
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3 -m pip install -r requirements.txt
2626
2727
- name: Build Apps
2828
run: |
29-
./build.command
29+
./build_nk.command
30+
/Library/Frameworks/Python.framework/Versions/3.13/bin/python3 patch.py
3031
- name: Create (Pre-)Release on Push
3132
if: github.event_name == 'push'
3233
uses: softprops/action-gh-release@v2
3334
with:
34-
tag_name: 0.90
35-
name: 1.0Pre
35+
tag_name: 0.91
36+
name: 1.0Pre2
3637
body: ${{ github.event.head_commit.message }}
3738
prerelease: true
3839
files: |
39-
./dist/AutoPkg-Assets.pkg
40-
./dist/OCLP-R.pkg
41-
./dist/OCLP-R-Uninstaller.pkg
40+
./dist/gui_converter.app
41+
4242
4343

README.md

Lines changed: 79 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
1-
# PNG to ICNS Converter
1+
# PNG to ICNS Converter & ZIP File Processing Tools
22

3-
This script converts PNG images to ICNS format, which is used for macOS icons.
3+
This repository contains tools for converting PNG images to ICNS format and processing ZIP files.
44

55
## Requirements
66

77
- Python 3.11, 3.12, or 3.13 (recommended)
88
- PIL (Pillow) library
9+
- Tkinter (usually included with Python)
10+
- Nuitka (for building standalone applications)
911

10-
Install Pillow with:
12+
You can install the required dependencies using:
1113
```
12-
pip install Pillow
14+
pip install -r requirements.txt
1315
```
1416

15-
## Usage
17+
### requirements.txt
18+
```
19+
Pillow>=8.0.0
20+
Nuitka>=1.0.0
21+
```
1622

17-
### Command Line Version
23+
Note: Tkinter is usually included with Python installations. For ZIP file GUI functionality, no additional dependencies are required beyond the standard library.
24+
25+
## PNG to ICNS Converter
26+
27+
### Usage
28+
29+
#### Command Line Version
1830

1931
Basic usage:
2032
```
@@ -26,7 +38,7 @@ Advanced usage with size options:
2638
python3 support/convert.py input.png output.icns --min-size 16 --max-size 512
2739
```
2840

29-
### GUI Version
41+
#### GUI Version
3042

3143
For a graphical interface, run:
3244
```
@@ -60,6 +72,47 @@ The build script will automatically:
6072
2. Use Python 3.13 for compilation
6173
3. Create a standalone .app bundle
6274

75+
## ZIP File Processing Tools
76+
77+
This repository also includes tools for creating, extracting, and managing ZIP files.
78+
79+
### Command Line Version
80+
81+
The command line tool supports several operations:
82+
83+
#### Create a ZIP file
84+
```
85+
python3 convertzip.py create output.zip file1.txt folder1/ file2.txt
86+
```
87+
88+
#### Extract a ZIP file
89+
```
90+
python3 convertzip.py extract archive.zip /path/to/extract/
91+
```
92+
93+
#### Add a file to existing ZIP
94+
```
95+
python3 convertzip.py add archive.zip newfile.txt
96+
```
97+
98+
#### List ZIP file contents
99+
```
100+
python3 convertzip.py list archive.zip
101+
```
102+
103+
### GUI Version
104+
105+
For a graphical interface for ZIP file operations, run:
106+
```
107+
python3 zip_gui.py
108+
```
109+
110+
The GUI provides tabs for:
111+
- Creating ZIP files from selected files and folders
112+
- Extracting ZIP files to a destination folder
113+
- Adding files to existing ZIP files
114+
- Listing the contents of ZIP files
115+
63116
## Alternative: Simple Launcher Script
64117

65118
If you cannot build the application with Nuitka, you can use the provided launcher script:
@@ -76,6 +129,7 @@ This script will run the application directly with Python without requiring comp
76129

77130
## Features
78131

132+
### PNG to ICNS Converter
79133
- Automatically generates multiple icon sizes from the original image
80134
- Supports retina (2x) versions for common sizes
81135
- Crops non-square images to square format
@@ -84,6 +138,14 @@ This script will run the application directly with Python without requiring comp
84138
- Progress indication during conversion
85139
- Automatic opening of the result in Preview app
86140

141+
### ZIP File Processing Tools
142+
- Create ZIP files from files and folders with progress tracking
143+
- Extract ZIP files with progress tracking
144+
- Add files to existing ZIP files
145+
- List contents of ZIP files
146+
- Both command-line and GUI interfaces
147+
- Error handling and user-friendly feedback
148+
87149
## Example
88150

89151
To convert a 256x256 PNG image to ICNS with default settings:
@@ -124,4 +186,14 @@ If you encounter issues with the build process, you can use the simple launcher
124186
Or run directly with Python 3.13:
125187
```
126188
python3.13 gui_converter.py
189+
```
190+
191+
For ZIP file operations, you can use either the command line:
192+
```
193+
python3 convertzip.py [command] [options]
194+
```
195+
196+
Or the GUI:
197+
```
198+
python3 zip_gui.py
127199
```
-7.67 KB
Binary file not shown.
9.96 KB
Binary file not shown.

build.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import subprocess,shutil
2+
3+
try:
4+
shutil.rmtree("build")
5+
except :
6+
pass
7+
try:
8+
shutil.rmtree("dist")
9+
except:
10+
pass
11+
print(subprocess.run("pyinstaller convert.spec",shell=True,capture_output=True,text=True))
12+
import patch

build.command renamed to build_nk.command

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ fi
1919
if [ ! -d "$PROJECT_DIR/support" ]; then
2020
echo "Error: support directory not found in project directory"
2121
exit 1
22+
23+
fi
24+
25+
# Install required dependencies
26+
echo "Installing required dependencies..."
27+
if [ -f "$PROJECT_DIR/requirements.txt" ]; then
28+
python3.13 -m pip install -r "$PROJECT_DIR/requirements.txt"
29+
else
30+
echo "Warning: requirements.txt not found. Installing default dependencies..."
31+
python3.13 -m pip install Pillow nuitka wxpython
2232
fi
2333

2434
# Create build directory
@@ -52,7 +62,7 @@ fi
5262

5363
# Install required dependencies if not already installed
5464
echo "Checking and installing dependencies..."
55-
python3.13 -m pip install Pillow nuitka
65+
python3.13 -m pip install Pillow nuitka wxpython
5666

5767
# Try to determine Python version
5868
PYTHON_VERSION=$(python3.13 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
@@ -69,10 +79,10 @@ BUILD_SUCCESS=0
6979
echo "Trying recommended build approach..."
7080
python3.13 -m nuitka \
7181
--standalone \
82+
--enable-plugin=no-qt \
7283
--macos-create-app-bundle \
7384
--macos-app-icon="$PROJECT_DIR/support/Success.icns" \
7485
--include-data-dir="$PROJECT_DIR/support=support" \
75-
--enable-plugin=tk-inter \
7686
--output-dir="$DIST_DIR" \
7787
--remove-output \
7888
"$PROJECT_DIR/gui_converter.py" && BUILD_SUCCESS=1
@@ -85,9 +95,9 @@ if [ $BUILD_SUCCESS -eq 0 ]; then
8595
python3.13 -m nuitka \
8696
--standalone \
8797
--macos-create-app-bundle \
98+
--enable-plugin=no-qt \
8899
--macos-app-icon="$PROJECT_DIR/support/Success.icns" \
89100
--include-data-dir="$PROJECT_DIR/support=support" \
90-
--enable-plugin=tk-inter \
91101
--output-dir="$DIST_DIR" \
92102
"$PROJECT_DIR/gui_converter.py" && BUILD_SUCCESS=1
93103
fi
@@ -99,8 +109,8 @@ if [ $BUILD_SUCCESS -eq 0 ]; then
99109
python3.13 -m nuitka \
100110
--standalone \
101111
--macos-create-app-bundle \
112+
--enable-plugin=no-qt \
102113
--include-data-dir="$PROJECT_DIR/support=support" \
103-
--enable-plugin=tk-inter \
104114
--output-dir="$DIST_DIR" \
105115
"$PROJECT_DIR/gui_converter.py" && BUILD_SUCCESS=1
106116
fi

convert.spec

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
import os
4+
import sys
5+
import time
6+
import subprocess
7+
8+
from pathlib import Path
9+
10+
from PyInstaller.building.api import PYZ, EXE, COLLECT
11+
from PyInstaller.building.osx import BUNDLE
12+
from PyInstaller.building.build_main import Analysis
13+
14+
sys.path.append(os.path.abspath(os.getcwd()))
15+
16+
17+
block_cipher = None
18+
19+
20+
21+
22+
23+
24+
a = Analysis(['gui_converter.py'],
25+
pathex=[],
26+
binaries=[],
27+
hiddenimports=[],
28+
hookspath=[],
29+
hooksconfig={},
30+
runtime_hooks=[],
31+
excludes=[],
32+
win_no_prefer_redirects=False,
33+
win_private_assemblies=False,
34+
cipher=block_cipher,
35+
noarchive=False)
36+
37+
pyz = PYZ(a.pure,
38+
a.zipped_data,
39+
cipher=block_cipher)
40+
41+
exe = EXE(pyz,
42+
a.scripts,
43+
[],
44+
exclude_binaries=True,
45+
name='gui_converter',
46+
debug=False,
47+
bootloader_ignore_signals=False,
48+
strip=False,
49+
upx=True,
50+
console=False,
51+
disable_windowed_traceback=False,
52+
target_arch="x86_64",
53+
codesign_identity=None,
54+
entitlements_file=None)
55+
56+
coll = COLLECT(exe,
57+
a.binaries,
58+
a.zipfiles,
59+
a.datas,
60+
strip=False,
61+
upx=True,
62+
upx_exclude=[],
63+
name='gui_vonverter')
64+
65+
app = BUNDLE(coll,
66+
name='gui_converter.app',
67+
icon="support/Success.icns",
68+
info_plist={
69+
"CFBundleName": "gui_converter",
70+
"CFBundleVersion": "1.0.0",
71+
"CFBundleShortVersionString": "1.0.0",
72+
"NSHumanReadableCopyright": "1.0.0",
73+
"LSMinimumSystemVersion": "11.0",
74+
"NSRequiresAquaSystemAppearance": False,
75+
"NSHighResolutionCapable": True,
76+
"Build Date": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
77+
"BuildMachineOSBuild": subprocess.run(["/usr/bin/sw_vers", "-buildVersion"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.decode().strip(),
78+
"NSPrincipalClass": "NSApplication",
79+
"CFBundleIconName": "converter",
80+
})

0 commit comments

Comments
 (0)