Skip to content

Commit

Permalink
polishing up for release 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ObaraEmmanuel committed Jun 14, 2020
1 parent e1c4cb8 commit c20f636
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 0 deletions.
2 changes: 2 additions & 0 deletions formation/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from .loader import Builder, AppBuilder

__version__ = '0.1.0'
16 changes: 16 additions & 0 deletions formation/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,22 @@ class AppBuilder(Builder):

def __init__(self, path, app=None, screenName=None, baseName=None, className: str = 'Tk', useTk=1, sync=0,
use=None):
"""
Create a builder object that automatically adds itself into a toplevel window
and resizes the window accordingly. The underlying toplevel window can
be accesses as builder_object._app. The private accessor undrscore is to
free as much as of the builder namespace to your user defined names and prevent
possible issues
:param path: Path to xml file created by the formation designer
:param app: optional custom external toplevel to use, if unspecified a toplevel window is
created for you
The rest of the parameters are specific to the underlying toplevel window
Return a new Toplevel widget on screen :param screenName. A new Tcl interpreter will
be created. :param baseName will be used for the identification of the profile file (see
readprofile).
It is constructed from sys.argv[0] without extensions if None is given. CLASSNAME
is the name of the widget class
"""
if app is None:
self._parent = self._app = tk.Tk(screenName, baseName, className, useTk, sync, use)
else:
Expand Down
2 changes: 2 additions & 0 deletions hoverset/ui/dialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def __init__(self, master, render_routine=None, **kw):
self.transient(master)
# take the screen focus
self.grab_set()
# prevent resizing by default
self.resizable(False, False)
self.bar = None
# Common dialogs
routines = {
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[metadata]
description-file = README.md
45 changes: 45 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from setuptools import setup
import formation
import sys

requirements = ['lxml', 'Pillow>=6.0.0', 'pyscreenshot']
if sys.platform == 'win32':
requirements.append('pywin32')

setup(
name='formation',
packages=['hoverset', 'hoverset.data', 'hoverset.platform', 'hoverset.ui', 'hoverset.util',
'formation',
'studio', 'studio.feature', 'studio.lib', 'studio.parsers', 'studio.ui'],
version=formation.__version__,
license='MIT',
description='Simplify GUI development in python',
author='Hoverset',
author_email='[email protected]',
url='https://github.com/ObaraEmmanuel/Formation',
keywords=['formation', 'gui', 'graphical-user-interface', 'drag drop', 'tkinter', 'hoverset'],
install_requires=requirements,
package_data={
'hoverset.data': ['image.*'],
'hoverset.ui': ['themes/*'],
'studio': ['resources/*/*']
},
entry_points={
'gui_scripts': [
'formation-studio = studio.main:main',
]
},
classifiers=[
'Development Status :: 3 - Alpha',
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable"
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Utilities',
'Topic :: Software Development :: User Interfaces',
'Operating System :: OS Independent'
],
)
31 changes: 31 additions & 0 deletions studio/ui/about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import os

from hoverset.ui.widgets import Frame, Label
from hoverset.ui.dialogs import MessageDialog
from hoverset.data.images import load_tk_image
from hoverset.data.utils import get_resource_path

import formation


class About(Frame):

def __init__(self, parent):
super().__init__(parent)
self.config(**self.style.dark)
image = load_tk_image(get_resource_path('studio', 'resources/images/logo.png'), 400, 129)
Label(self, image=image, **self.style.dark).pack(side="top", fill="y")
Label(self, text="Version {} alpha".format(formation.__version__),
**self.style.dark_text).pack(side="top", fill="y", pady=15)
Label(self, text="Make designing user interfaces in python a breeze!",
**self.style.dark_text).pack(side="top", fill="y", pady=5)
copy_right = "Copyright © 2019-2020 Hoverset group"
Label(self, text=copy_right, **self.style.dark_text_passive).pack(side="top", fill="y")
self.pack(fill="both", expand=True)


def about_window(parent):
dialog = MessageDialog(parent, About)
dialog.title("Formation")
dialog.focus_set()
return dialog
1 change: 1 addition & 0 deletions win_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pyscreenshot
Pillow>=6.2.1
lxml
pywin32

0 comments on commit c20f636

Please sign in to comment.