Skip to content
This repository was archived by the owner on Mar 21, 2022. It is now read-only.

Commit 322a26f

Browse files
committed
multiply files support for gui
1 parent 9031848 commit 322a26f

5 files changed

Lines changed: 26 additions & 23 deletions

File tree

freeze.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
app=[mainscript],
1616
options={'py2app': {'argv_emulation': False,
1717
'iconfile': 'icos/icon.icns',
18+
'packages': ['PIL'],
1819
'plist': {
1920
'CFBundleName': name,
20-
'CFBundleShortVersionString': '1.0.1',
21-
'CFBundleVersion': '1.0.1',
21+
'CFBundleShortVersionString': '0.1.2',
22+
'CFBundleVersion': '0.1.2',
2223
'NSHumanReadableCopyright': '@Herb Brewer 2014'
2324
}
2425
}})

icons/gui.py

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,17 @@ def _main_():
145145
output_path = tk.StringVar(window, '')
146146

147147
icon_types = []
148-
icon_types.append(('icon', 'App Icon'))
149-
icon_types.append(('launch',
150-
'App Lauch Image'))
151148
icon_types.append(('image', 'Icon'))
152-
icon_types.append(('favicon', 'Favicon'))
149+
icon_types.append(('tab', 'Tabbar Icon'))
153150
icon_types.append(('toolbar',
154151
'Toolbar Icon'))
155-
icon_types.append(('tab', 'Tabbar Icon'))
152+
icon_types.append(('icon', 'App Icon'))
153+
icon_types.append(('launch',
154+
'App Lauch Image'))
156155
icon_types.append(('notification',
157156
'Notification Icon'))
158-
icon_type = tk.StringVar(window, 'icon')
157+
icon_types.append(('favicon', 'Favicon'))
158+
icon_type = tk.StringVar(window, 'image')
159159
device_type = tk.StringVar(window, 'device')
160160

161161
baseline = tk.IntVar(window, 3, 'baseline')
@@ -296,19 +296,23 @@ def on_select_icon(event):
296296
return
297297
window.is_picking_file = True
298298
if hasattr(event, 'data'):
299-
icon_path = event.data.split()[0]
300-
_, ext = os.path.splitext(icon_path)
301-
if ext.lower() not in ['.png', '.jpg', '.jpeg', '.bmp']:
302-
return
299+
icon_paths = []
300+
input_icon_paths = event.data.split()
301+
for icon_path in input_icon_paths:
302+
_, ext = os.path.splitext(icon_path)
303+
if ext.lower() not in ['.png', '.jpg', '.jpeg', '.bmp']:
304+
continue
305+
icon_paths.append(icon_path)
303306
else:
304-
icon_path = filedialog.\
307+
icon_paths = filedialog.\
305308
askopenfilename(title='Select your icon',
309+
multiple=True,
306310
filetypes=[('Images', '.png .jpg .jpeg .bmp')])
307-
if icon_path:
311+
for icon_path in icon_paths:
308312
try:
309313
image = Image.open(icon_path)
310314
except Exception:
311-
return
315+
continue
312316

313317
image_name, _ = os.path.splitext(os.path.basename(icon_path))
314318
if output_path.get():

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
setup(name='icons',
8-
version='0.1.1',
8+
version='0.1.2',
99
description='generate icons of all sizes and config file ' +
1010
'(e.g. Contents.json) required by iOS or Android app, ' +
1111
'inspired by http://makeappicon.com',

web/main.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ def get(self):
3333
self.response.write(template.render())
3434

3535
def post(self):
36-
image_type = self.request.get('type', 'icon')
37-
if image_type not in supported_types():
38-
image_type = 'icon'
36+
image_type = self.request.get('type', 'image')
3937
file = StringIO.StringIO(self.request.get('file'))
4038
zip_file = StringIO.StringIO()
4139
with closing(ZipFile(zip_file, 'w', ZIP_DEFLATED)) as tmp:

web/template/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ <h1>Drop Icon Below</h1>
6060
<div id="main">
6161
<form id="dropzone" action="/" method="post"></form>
6262
<select id="type">
63-
<option value="icon">App Icon</option>
64-
<option value="launch">App Lauch Image</option>
65-
<option value="toolbar">Toolbar Icon</option>
63+
<option value="image">Icon</option>
6664
<option value="tab">Tabbar Icon</option>
67-
<option value="image">Common</option>
65+
<option value="toolbar">Toolbar Icon</option>
6866
<option value="notification">Notification Icon</option>
67+
<option value="icon">App Icon</option>
68+
<option value="launch">App Lauch Image</option>
6969
<option value="favicon">Favicon</option>
7070
</select>
7171
<p id="download" style="text-align: center;"></p>

0 commit comments

Comments
 (0)