Skip to content

Commit

Permalink
New version: now shows a bundled bitmap logo (Mu's).
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontes committed Oct 11, 2020
1 parent 2314f48 commit 21b8820
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 5 deletions.
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"Programming Language :: Python :: 3.8",
]
INSTALL_REQUIRES = [
"importlib-metadata==1.7.0;python_version<'3.8'",
"importlib-metadata==1.7.0",
"importlib-resources==3.0.0",
]
EXTRAS_REQUIRE = {
"docs": [
Expand Down Expand Up @@ -84,6 +85,9 @@ def find_meta(meta):
long_description_content_type='text/x-rst',
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
package_data={
"": ["*.png"],
},
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=INSTALL_REQUIRES,
Expand Down
2 changes: 1 addition & 1 deletion src/puppy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Puppy - A minimal GUI app to test pup.
"""

__version__ = '1.1.0'
__version__ = '1.2.0'

__title__ = 'puppy'
__description__ = 'Puppy, a minimal GUI app to test pup'
Expand Down
26 changes: 23 additions & 3 deletions src/puppy/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import sys
import tkinter

import importlib_metadata as ilr
import importlib_metadata as ilm
import importlib_resources as ilr



Expand All @@ -25,7 +26,7 @@ def _create_window():
window.geometry(f'{w}x{h}+{x}+{y}')
window.minsize(w, h)

meta = ilr.metadata(__package__)
meta = ilm.metadata(__package__)
name = meta['name']
version = meta['version']
window.title(f'{name} {version}')
Expand All @@ -35,10 +36,29 @@ def _create_window():

def _add_widgets(window):

top_frame = tkinter.Frame()

file_path = ilr.files(__package__) / 'logo.png'

# Must keep reference to PhotoImage, otherwise it doesn't become visible
_add_widgets.img = tkinter.PhotoImage(file=file_path)
tkinter.Label(
window,
top_frame,
image=_add_widgets.img,
).pack(
side='left',
)

tkinter.Label(
top_frame,
text='Minimal GUI app to test pup.',
justify=tkinter.LEFT,
).pack(
side='left',
padx=16,
)

top_frame.pack(
side='top',
fill='x',
padx=16,
Expand Down
Binary file added src/puppy/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 21b8820

Please sign in to comment.