coretk - updated pipfile to install as editable, added convenient run script, updated images to load assuming local path

This commit is contained in:
Blake Harnden 2019-09-18 11:20:22 -07:00
parent 00a37cbb6f
commit 8682f01fdc
5 changed files with 28 additions and 7 deletions

View file

@ -3,10 +3,13 @@ name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[scripts]
coretk = "python coretk/app.py"
[dev-packages]
flake8 = "*"
isort = "*"
black = "==19.3b0"
[packages]
pillow = "*"
coretk = {editable = true,path = "."}

11
coretk/Pipfile.lock generated
View file

@ -1,12 +1,10 @@
{
"_meta": {
"hash": {
"sha256": "c719ca1ace4a33dfe01fe579162d4557e8711819c4e7b4f8e799dd25b9cde596"
"sha256": "f5abf95b09f7c7431b5d2143b43b6873cf9cf7d90dfb2eaad08d2446368a0a05"
},
"pipfile-spec": 6,
"requires": {
"python_version": "3.7"
},
"requires": {},
"sources": [
{
"name": "pypi",
@ -16,6 +14,10 @@
]
},
"default": {
"coretk": {
"editable": true,
"path": "."
},
"pillow": {
"hashes": [
"sha256:0804f77cb1e9b6dbd37601cee11283bba39a8d44b9ddb053400c58e0c0d7d9de",
@ -45,7 +47,6 @@
"sha256:ef6be704ae2bc8ad0ebc5cb850ee9139493b0fc4e81abcc240fb392a63ebc808",
"sha256:f8dc19d92896558f9c4317ee365729ead9d7bbcf2052a9a19a3ef17abbb8ac5b"
],
"index": "pypi",
"version": "==6.1.0"
}
},

View file

@ -20,7 +20,6 @@ class Application(tk.Frame):
def setup_app(self):
self.master.title("CORE")
self.master.geometry("800x600")
self.master.state("zoomed")
image = Images.get("core")
self.master.tk.call("wm", "iconphoto", self.master._w, image)
self.pack(fill=tk.BOTH, expand=True)

View file

@ -1,11 +1,15 @@
import os
from PIL import Image, ImageTk
PATH = os.path.abspath(os.path.dirname(__file__))
class Images:
images = {}
@classmethod
def load(cls, name, file_path):
file_path = os.path.join(PATH, file_path)
image = Image.open(file_path)
tk_image = ImageTk.PhotoImage(image)
cls.images[name] = tk_image

14
coretk/setup.py Normal file
View file

@ -0,0 +1,14 @@
from setuptools import find_packages, setup
setup(
name="coretk",
version="0.1.0",
packages=find_packages(),
install_requires=[
"pillow",
],
description="CORE GUI",
url="https://github.com/coreemu/core",
author="Boeing Research & Technology",
license="BSD",
)