You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven’t really used easypypi, but had a glimpse at it. It all looks impressive.
I was surprised to see that you had organized the UI as a linear number of lists. That has the disadvantage that you have to go through ALL questions and that you can’t go back and don’t have an overview.
Would it be much nicer to have a window with all the prompts, where you can just what you want.
In order to demonstrate what I mean, I have made a mockup:
image
image
763×397 15.9 KB
Please observe that the checkbox options are kind of special. The fields are actually Text elements that trigger another window with the checkboxes:
image
image
765×399 14.6 KB
Here’s the -not very elegant- code of the mockup:
import PySimpleGUI as sg
def prompt_with_checkboxes(group, choices, selected_choices):
"""
Creates a scrollable checkbox popup using PySimpleGui
Returns a set of selected choices, or and empty set
"""
prompt = [sg.Text(text=f"Please select any relevant classifiers in the {group.title()} group:")]
layout = [[sg.Checkbox(text=choice, key=choice, default=choice in selected_choices)] for choice in choices]
event, values = sg.Window(
"", [prompt, [sg.Column(layout)], [sg.Button("Accept"), sg.Button("Cancel")]], resizable=True, no_titlebar=True
).read(close=True)
if event == "Accept":
selected_choices.clear()
selected_choices.extend(k for k in choices if values[k])
return True
if event is None or event == "Cancel":
return False
sg.theme("DarkAmber")
prompts = {
"name": "Name for this package (all lowercase, underscores if needed)",
"version": "Latest version number",
"github_id": "Your Github or main repository ID",
"url": "Link to the package repository",
"description": "Description with escape characters for \ " ' etc.",
"author": "Full name of the author",
"email": "E-mail address for the author",
"keywords": "Some keywords separated by a comma",
"requirements": "Any packages/modules that absolutely need to be installed",
}
answer = {}
answer["name"] = "salabim"
answer["version"] = "20.0.6"
answer["github_id"] = "www.ggithub.com/salabim/salabim"
answer["url"] = "www.salabim.org"
answer["description"] = "Discrete event simulation in Python"
answer["author"] = "Ruud van der Ham"
answer["email"] = "info@salabim.org"
answer["keywords"] = "simulation,engineering,logistics"
answer["requirements"] = ""
I haven’t really used easypypi, but had a glimpse at it. It all looks impressive.
I was surprised to see that you had organized the UI as a linear number of lists. That has the disadvantage that you have to go through ALL questions and that you can’t go back and don’t have an overview.
Would it be much nicer to have a window with all the prompts, where you can just what you want.
In order to demonstrate what I mean, I have made a mockup:
image
image
763×397 15.9 KB
Please observe that the checkbox options are kind of special. The fields are actually Text elements that trigger another window with the checkboxes:
image
image
765×399 14.6 KB
Here’s the -not very elegant- code of the mockup:
import PySimpleGUI as sg
def prompt_with_checkboxes(group, choices, selected_choices):
"""
Creates a scrollable checkbox popup using PySimpleGui
Returns a set of selected choices, or and empty set
"""
prompt = [sg.Text(text=f"Please select any relevant classifiers in the {group.title()} group:")]
layout = [[sg.Checkbox(text=choice, key=choice, default=choice in selected_choices)] for choice in choices]
event, values = sg.Window(
"", [prompt, [sg.Column(layout)], [sg.Button("Accept"), sg.Button("Cancel")]], resizable=True, no_titlebar=True
).read(close=True)
sg.theme("DarkAmber")
prompts = {
"name": "Name for this package (all lowercase, underscores if needed)",
"version": "Latest version number",
"github_id": "Your Github or main repository ID",
"url": "Link to the package repository",
"description": "Description with escape characters for \ " ' etc.",
"author": "Full name of the author",
"email": "E-mail address for the author",
"keywords": "Some keywords separated by a comma",
"requirements": "Any packages/modules that absolutely need to be installed",
}
answer = {}
answer["name"] = "salabim"
answer["version"] = "20.0.6"
answer["github_id"] = "www.ggithub.com/salabim/salabim"
answer["url"] = "www.salabim.org"
answer["description"] = "Discrete event simulation in Python"
answer["author"] = "Ruud van der Ham"
answer["email"] = "info@salabim.org"
answer["keywords"] = "simulation,engineering,logistics"
answer["requirements"] = ""
layout = []
for key, prompt in prompts.items():
choices = {}
selected_choices = {}
for group in "Development Status|Intended Audience|Operating System|Programming Language :: |Topic".split("|"):
choices[group] = [option for option in "Option 1|Option 2|Option 3|Option 4|Option 5|Option 6|Option 7|Option 8".split("|")]
selected_choices[group] = []
if group == "Programming Language :: ":
selected_choices[group] = "Option 3|Option 4|Option 5|Option 7|Option 8".split("|")
layout += [
[
sg.Text(group, size=(50, 1)),
sg.Text(
", ".join(selected_choices[group]),
key=("group", group),
enable_events=True,
size=(40, 0),
background_color=sg.theme_input_background_color(),
text_color=sg.theme_text_color(),
),
]
]
window = sg.Window("easypypi", layout)
while True:
event, values = window.read()
if event is None:
break
What do you think of that?
The text was updated successfully, but these errors were encountered: